Comment 13 for bug 144431

Revision history for this message
In , Andrey Nikolaev (nikolaeff) wrote :

gethostbyname() fails to resolve domain names with minus sign at beginning or end of domain name,
in example -kol.deviantart.com, while it can be resolved using host and nslookup.

example sessiong:

insa@devel:~$ ping -- -kol.deviantart.com
ping: unknown host -kol.deviantart.com

insa@devel:~$ host -- -kol.deviantart.com
-kol.deviantart.com has address 69.28.181.43

Breif look at linux iputils/ping.c shows that it's using gethostbyname() function.
So i wrote C test example that can be found at http://insa.pp.ru/files/bugs/gethost.c

Tested on Debian 3.1, Debian 4, FreeBSD 5.4. All i386.
Mac OS X not affected.