gethostbyname() cant resolve names starting/ending with "-"
Bug #144431 reported by
Alexey Ten (Lynn)
This bug affects 12 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
Confirmed
|
Medium
|
|||
glibc (Ubuntu) |
Invalid
|
Low
|
Unassigned |
Bug Description
This is copy from http://
gethostbyname() fails to resolve domain names with hyphen sign (-) at beginning or end of domain name,
in example "-kol.deviantar
example session:
lynn@wastebin:~$ ping -- -kol.deviantart.com
ping: unknown host -kol.deviantart.com
lynn@wastebin:~$ host -- -kol.deviantart.com
-kol.deviantart.com has address 198.172.81.21
I know that RFC3696 says that this hostname is invalid, but 123.deviantart.com is invalid too and it's resolved perfectly.
Also this hostname resolves in Windows and Mac OS X.
Changed in glibc: | |
status: | Unknown → Invalid |
Changed in glibc: | |
status: | Invalid → Confirmed |
Changed in glibc: | |
importance: | Unknown → Medium |
To post a comment you must log in.
gethostbyname() fails to resolve domain names with minus sign at beginning or end of domain name, .com, while it can be resolved using host and nslookup.
in example -kol.deviantart
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. insa.pp. ru/files/ bugs/gethost. c
So i wrote C test example that can be found at http://
Tested on Debian 3.1, Debian 4, FreeBSD 5.4. All i386.
Mac OS X not affected.