You are not logged in.
Hi everyone,
I'm really at a loss here: Somehow my system seems to ignore the /etc/hosts file completely. Here is a little excerpt from my console that should make the problem clear:
[root@deanna etc]# host gerrit.hadiko.de
gerrit.hadiko.de is an alias for vm34.hadiko.de.
vm34.hadiko.de has IPv6 address 2001:7c0:409:8001::32:134
[root@deanna etc]# host doesnotexist.hadiko.de
Host doesnotexist.hadiko.de not found: 3(NXDOMAIN)
[root@deanna etc]# cat hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost deanna
172.20.32.134 gerrit.hadiko.de
172.20.32.135 doesnotexist.hadiko.de
[root@deanna etc]# cat nsswitch.conf
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
publickey: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
# End /etc/nsswitch.confThe data for gerrit.hadiko.de is retrieved from the hadiko.de nameserver (which doesn't deliver the IPv4 address to the public internet, but I need it anyways..)
What am I doing wrong? Why is the resolver not looking at the hosts file? I have no nscd running. I'd be really glad if anyone could give me a hint here...
Thanks,
tinloaf
Solution: 'host' is a DNS lookup tool. *facepalm* .. Thanks folks.
Last edited by tinloaf (2012-08-20 20:40:04)
Offline
If you know about nscd, then you probably read about dns caching. Did you restart the network daemon, or - maybe - even reboot?
Offline
"host" is a DNS lookup utility. It performs DNS lookups directly, not using system resolver(3) libraries, and thus ignoring the /etc/hosts file.
Try another utility like ping, ...
Offline
If you don't like ping, use "getent ahosts some.domain"
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Now I feel like a complete newbie. Thanks folks, I really didn't know that, don't ask me why git and ssh had problems - caching probably.
Offline