all groups > sql server programming > april 2006 >
You're in the

sql server programming

group:

DNS Hostnames


DNS Hostnames Mike Labosh
4/14/2006 10:06:42 PM
sql server programming:
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


Re: DNS Hostnames Razvan Socol
4/14/2006 10:35:25 PM
Hello, 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
Re: DNS Hostnames Martin C K Poon
4/15/2006 12:00:00 AM
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/Internationalized_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> ¦b¶l¥ó
news:%23dKp$EDYGHA.1352@TK2MSFTNGP05.phx.gbl ¤¤¼¶¼g...
[quoted text, click to view]

Re: DNS Hostnames Mike Labosh
4/15/2006 12:00:00 AM
[quoted text, click to view]

PERFECT! THANKS!

--


Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei

AddThis Social Bookmark Button