Sun 06 Mar 2005 10:07:22 PM UTC, comment #7:
Ah, now I understand what you're trying to do.
It's not a bug in pnet, but a configuration error by you.
"The domain name queries carried out by gethostbyname() and gethostbyaddr() use a combination of any or all of the name server named(8), a broken out line from /etc/hosts, and the Network Information Service (NIS or YP), depending upon the contents of the order line in /etc/host.conf." - gethostbyname(3), man page.
You see, even if the hostname is set to a certain value, you either need a name server to resolve the name to an address, or if you have defined the name in /etc/hosts to be able to actually resolve the name. It can't magically be resolved unless something specifies the address for the name.
Example:
ptah@bar:~$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
ptah@bar:~$ ping bar
ping: unkown host bar
root@bar:/home/ptah# echo 192.168.0.26 localhost.localdomain bar >> /etc/hosts
ptah@bar:~$ ping bar
PING localhost.localdomain (192.168.0.26) 56(84) bytes of data.
64 bytes from localhost.localdomain (192.168.0.26): icmp_seq=1 ttl=64 time=0.443 ms
Don't think I can be clearer than that...
This bug is bogus, closed Sunday, 6 March.
|