1

I have a problem with name resolution on one of my Pis. I have set my router to start dnsmasq with LAN domain local. Other systems except this Pi can ping host.local addresses just fine.

I installed dnsutils on my Pi to see if this is a DNSMasq problem. When I do nslookup ipad.local, I get the IP and the correct response. But when I do ping ipad.local, the name doesn't get resolved. However, to my surprise, when I change it omitting .local, it works: ping ipad How can I make the .local domain get resolved?

0

Turn out I had to change priorities in /etc/nsswitch.conf : from: hosts: files mdns4_minimal [NOTFOUND=return] dns to hosts: files dns myhostname mymachines mdns4_minimal [NOTFOUND=return] It gives DNS server results priority over avahi.

0

nslookup is part of dnsutils so you need to install that with:

sudo apt install dnsutils

First test:

pi@raspberry:~ $ nslookup lanhost.local
Server:         10.25.2.65
Address:        10.25.2.65#53

Name:   lanhost.local
Address: 10.25.2.67

pi@raspberry:~ $ ping lanhost.local
ping: unknown host lanhost.local

So nslookup works, but ping doesn't. As sozkara mentiones. We need to edit /etc/nsswitch.conf.

sudo nano /etc/nsswitch.conf

Change this line

hosts:          files mdns4_minimal [NOTFOUND=return] dns

so it looks like this

hosts:          files dns myhostname mymachines mdns4_minimal [NOTFOUND=return]

Second Test:

pi@raspberry:~ $ ping lanhost.local
PING lanhost.local (10.25.2.67) 56(84) bytes of data.
64 bytes from lanhost.local (10.25.2.67): icmp_seq=1 ttl=128 time=1.69 ms
64 bytes from lanhost.local (10.25.2.67): icmp_seq=2 ttl=128 time=0.783 ms
64 bytes from lanhost.local (10.25.2.67): icmp_seq=3 ttl=128 time=0.558 ms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.