[Cialug] nslookup works but ping cannot resolve

Nathan Stien nathanism at gmail.com
Thu Feb 7 14:12:16 CST 2008


Hello Luggers,

Does anyone out there know what might cause a system to be able to
resolve a hostname with nslookup (and `host`) but not with programs
that use gethostbyname()?

On my home network, I have a router running dd-wrt.  It runs dnsmasq
for caching and local name resolution.

After wiping and installing a new system on my laptop (Ubuntu Gutsy),
I find that I cannot resolve local names like I used to be able to.
It still works on all my other machines.

I can do "ping google.com" and it works.  I can do "nslookup
other_local_machine" to look up any local machine.  But when I try to
"ping other_local_machine", I can't resolve the name.  Pinging numeric
IPs works fine.

To make matters weirder, if I edit /etc/resolv.conf and take out the
"search " line with my domain, I can resolve local names normally.
But /etc/resolv.conf is written by NetworkManager and gets its info
from DHCP.

So what am I missing that would just make this work right?

- Nathan


More information about the Cialug mailing list