hello... it appears that host, and interfaces that use gethostbyname(), are ignoring my /etc/hosts file. the behavior of this _should_ be controlled by /etc/nsswitch.conf. indeed, i have the following lines present: hosts: files dns networks: files dns still, running host on some entry in this file causes it to de ignored. deleting dns from /etc/nsswitch.conf didn't help... this is a pretty big problem imo, since apps like netscape like to use gethostbyname() to resolve hosts. when your hostname is fake (but listed in etc/hosts), this can cause some strange headaches. cheers..
The "host" program uses your /etc/resolv.conf and queries a DNS server directly. It does not use /etc/nsswitch.conf, /lib/libnss.so, or gethostbyname(). Whereas a general network program like ping, looks at /etc/nsswitch.conf and uses /etc/hosts (if files is listed), ect. Mozzila should as well, I would think. A simple C program can test the gethostbyname() interface, to proove this: #include <netdb.h> #include <stdio.h> int main(int argc, char **argv) { char **ptr; char str[INET6_ADDRSTRLEN]; struct hostent *h; if (argc < 2) return 1; h = gethostbyname(argv[1]); ptr = h->h_addr_list; for ( ; *ptr != NULL; ptr++) { printf("[%s]\n", inet_ntop(h->h_addrtype, *ptr, str, sizeof(str))); } return 0; } To compile run gcc -o test test.c (assuming source is put into test.c) ./test foobar (assuming foobar is in your /etc/hosts, and /etc/nsswitch.conf is setup properly) Also, there's a command called strace that will allow you to see all the system calls that a program runs. emerge strace to install it. Then you can do something like strace host foobar 2> strace.log less strace.log and you will see that it never looks at or uses /etc/nsswitch.conf, it connects directly to your nameservers listed in /etc/resolv.conf where as if you do a strace ping foobar 2> strace.log less strace.log You will see it look at /etc/nsswitch.conf, and go from there.