Wednesday, March 21, 2012

DNS Hostnames

I'm chewing on a DNS blacklisting system that needs to store a list of
blacklisted hosts. I am having difficulty in deciding whether to use
VARCHAR or NVARCHAR for the hostname column.
Can anyone think of a reason why I might need to store a hostname
containing, say, Chinese characters? Is that even allowed in a hostname?
Peace & happy computing,
Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"Escriba coda ergo sum." -- vbSenseiHello, Mike
According to RFC 1035, a domain name may contain uppercase and
lowercase letters (A-Z, a-z), digits (0-9), hypens (-) and points (.).
According to RFC 1738, an URL may contain only printable ASCII
characters (non-printable ASCII characters, but also some printable
characters, should be encoded with %).
In conclusion, it's better to use a varchar column instead of a
nvarchar in this case.
Razvan|||VARCHAR should be used for the hostname column.
Unicode is allowed to appear in internationalized domain names (IDN) as
defined in IDNA, but it's the responsibility of the application (e.g.,
browser) to convert the IDN to restricted-ASCII representation.
From Wikipedia: http://en.wikipedia.org/wiki/Intern...ed_domain_names
Internationalizing Domain Names in Applications (IDNA) is a mechanism
defined in 2003 for handling internationalized domain names containing
non-ASCII characters. Such domain names could not be handled by the existing
DNS and name resolver infrastructure. Rather than redesigning the existing
DNS infrastructure, it was decided that non-ASCII domain names should be
converted to a suitable ASCII-based form by web browsers and other user
applications; IDNA specifies how this conversion is to be done.
Martin C K Poon
Senior Analyst Programmer
====================================
"Mike Labosh" <mlabosh_at_hotmail.com> bl
news:%23dKp$EDYGHA.1352@.TK2MSFTNGP05.phx.gbl g...
> I'm chewing on a DNS blacklisting system that needs to store a list of
> blacklisted hosts. I am having difficulty in deciding whether to use
> VARCHAR or NVARCHAR for the hostname column.
> Can anyone think of a reason why I might need to store a hostname
> containing, say, Chinese characters? Is that even allowed in a hostname?
> --
>
> Peace & happy computing,
> Mike Labosh, MCSD MCT
> Owner, vbSensei.Com
> "Escriba coda ergo sum." -- vbSensei
>
>|||> According to RFC 1035, a domain name may contain uppercase and
> lowercase letters (A-Z, a-z), digits (0-9), hypens (-) and points (.).
> According to RFC 1738, an URL may contain only printable ASCII
> characters (non-printable ASCII characters, but also some printable
> characters, should be encoded with %).
PERFECT! THANKS!
Peace & happy computing,
Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"Escriba coda ergo sum." -- vbSensei

No comments:

Post a Comment