2

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?

1
1

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.

1
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Dec 28 '19 at 23:03
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
0

Because you also tagged the raspberrypi zero: Windows does not implement mDNS properly. For that you need a servoce like Bonjour. This allows devices to register properly on .local

See here for further information https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux

(might also hrlp with other

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .