nslookup works, but ping doesn't
by blippy from LinuxQuestions.org on (#50BR1)
I've set up my Raspberry Pi (on 192.168.0.27) with dnsmasque.
From my x86_64 Slackware/Absolute box, I can lookup hosts:
$ nslookup pi2w 192.168.0.27
Server: 192.168.0.27
Address: 192.168.0.27#53
Name: pi2w
Address: 192.168.0.27
But when I do
$ ping pi2w
ping: pi2w: Name or service not known
So it appears that the Pi is serving names correctly, but resolv.conf is not being examined by ping for name servers. Here is /etc/resolv.conf:
# created 06-mar-2020
search absolute.net
nameserver 192.168.0.1
nameserver 192.168.0.27
nameserver 212.23.3.10
nameserver 212.23.6.10
resolv.conf survives a reboot, so I don't understand why ping isn't using the nameserver provided by the Pi.
Update: Ah, I fixed the problem. I removed the line for 192.168.0.1 . That's my router. It seems to be causing the lookup to go wrong.


From my x86_64 Slackware/Absolute box, I can lookup hosts:
$ nslookup pi2w 192.168.0.27
Server: 192.168.0.27
Address: 192.168.0.27#53
Name: pi2w
Address: 192.168.0.27
But when I do
$ ping pi2w
ping: pi2w: Name or service not known
So it appears that the Pi is serving names correctly, but resolv.conf is not being examined by ping for name servers. Here is /etc/resolv.conf:
# created 06-mar-2020
search absolute.net
nameserver 192.168.0.1
nameserver 192.168.0.27
nameserver 212.23.3.10
nameserver 212.23.6.10
resolv.conf survives a reboot, so I don't understand why ping isn't using the nameserver provided by the Pi.
Update: Ah, I fixed the problem. I removed the line for 192.168.0.1 . That's my router. It seems to be causing the lookup to go wrong.