#nslookup localhost
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: localhost.xxx.xxx.xxx
Address: 60.195.191.230
ping localhost it will use the correct 127.0.0.1 address because the system resolver does use /etc/hosts. Doing telnet localhost 25 works for the same reason.kpa said:The problem is that nslookup(1) does not use /etc/hosts and it tries a DNS lookup using the settings in /etc/resolv.conf but fails, this is by design. If you do for example a simpleping localhostit will use the correct 127.0.0.1 address because the system resolver does use /etc/hosts. Doingtelnet localhost 25works for the same reason.