Forum
[SOLVED] Cannot resolve .local host names via mDNS. - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Network (/forum-25.html)
+--- Thread: [SOLVED] Cannot resolve .local host names via mDNS. (/thread-3981.html)



Cannot resolve .local host names via mDNS. - dreamweaver - 29th Jun, 2018 09:58 AM

Software
XBian version: 20180627-0 (from /etc/motd)
XBMC/Kodi version: 17.6
Overclock settings: default

Hardware
Device type and model: Raspberry Pi 3 Model B
Power supply rating: 2A
SD card size and make/type: SanDisk EVO+ microSD 32GB
Network (Ethernet or wireless): Ethernet
Connected devices: TV

Problem description:
Cannot resolve .local host names via mDNS.

How to reproduce:
The following commands are run on the XBian system in an ssh session.

Avahi-daemon is running:
avahi 17390 1 0 Jun28 ? 00:00:00 avahi-daemon: running [xbian.local]
avahi 17392 17390 0 Jun28 ? 00:00:00 avahi-daemon: chroot helper

Host name resolution using the avahi tools works, e.g.
# avahi-resolve-host-name centos.local
centos.local 10.1.1.4

mDNS is configured in /etc/nsswitch.conf:
hosts: files mdns4_minimal [NOTFOUND=return] dns

However resolution of .local hosts fails:
# ping centos.local
ping: bad address 'centos.local'

I see the requests for .local hosts being passed through to DNS.
It is though the mdns4_minimal directive in nsswitch.conf is being ignored.

The same setup works fine in Raspbian.


RE: Cannot resolve .local host names via mDNS. - Nachteule - 4th Jul, 2018 04:00 AM

Hmm, actually I do not have a lot experience with that stuff, but

after installing avahi-utils package

Terminal

sudo apt-get install avahi-utils

it works out of the box without any additional configuration required:

Terminal

root@kmxbilr2 ~ # avahi-resolve-host-name kmcubie.local
kmcubie.local 192.168.1.6
root@kmxbilr2 ~ # ping kmcubie.local
PING kmcubie.local (192.168.1.6): 56 data bytes
64 bytes from 192.168.1.6: icmp_seq=0 ttl=64 time=1,353 ms
64 bytes from 192.168.1.6: icmp_seq=1 ttl=64 time=1,167 ms
^C--- kmcubie.local ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1,167/1,260/1,353/0,093 ms
root@kmxbilr2 ~ #

Entry in /etc/nsswitch was already there
Terminal

root@kmxbilr2 ~ # grep hosts /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

Do you have mdns4 in your nsswitch.conf?

I can't find it in your post Dodgy, but after removing this parameter it's still working


RE: Cannot resolve .local host names via mDNS. - Nachteule - 4th Jul, 2018 04:33 AM

Probably you're missing libnss-mdns package


RE: Cannot resolve .local host names via mDNS. - dreamweaver - 4th Jul, 2018 09:55 AM

Thanks Nachteule, installing libnss-mdns fixed the problem.


RE: Cannot resolve .local host names via mDNS. - Nachteule - 4th Jul, 2018 10:50 PM

Fine, thanks for your response

I'm thinking about how to add this package to the standard image, because all my Pi installations have that package installed, and all that installations are 5 years old and originally based on Debian Wheezy. So, I would assume that when moved from Wheezy to Jessie that package was lost, probably due to a dropped dependency.

Set to solved