Avahi-resolve works, but not ping to somehost.local?

I wasn’t asking you to install it. I was asking if this name resolution service was in use. Just something to exclude. I’m not using it either, and ping works here (openSUSE Slowroll host) with respect to Avahi hostnames.

You could watch watch for mDNS traffic eg for network interface eth0

tcpdump -i eth0 udp port 5353

and then try to ping an Avahi host via another terminal.

For example, here’s a snippet obtained when I ping linux-lptp1.local

# tcpdump -i wlp1s0 udp port 5353
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on wlp1s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
09:25:25.838891 IP 192.168.0.79.mdns > mdns.mcast.net.mdns: 0 [3q] PTR (QU)? _companion-link._tcp.local. PTR (QU)? _rdlink._tcp.local. PTR (QU)? lb._dns-sd._udp.local. (80)
09:25:25.838891 IP6 fe80::108f:ac4d:b4d7:1827.mdns > ff02::fb.mdns: 0 [3q] PTR (QU)? _companion-link._tcp.local. PTR (QU)? _rdlink._tcp.local. PTR (QU)? lb._dns-sd._udp.local. (80)
09:25:25.985791 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:25.986010 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:26.349846 IP 192.168.0.79.mdns > mdns.mcast.net.mdns: 0 [3q] PTR (QM)? _companion-link._tcp.local. PTR (QM)? _rdlink._tcp.local. PTR (QM)? lb._dns-sd._udp.local. (80)
09:25:26.349846 IP6 fe80::108f:ac4d:b4d7:1827.mdns > ff02::fb.mdns: 0 [3q] PTR (QM)? _companion-link._tcp.local. PTR (QM)? _rdlink._tcp.local. PTR (QM)? lb._dns-sd._udp.local. (80)
09:25:26.986172 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:26.986427 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:28.988062 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:28.988303 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 [2q] A (QM)? linux-lptp1.local. PTR (QM)? 7.2.8.1.7.d.4.b.d.4.c.a.f.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (113)
09:25:29.114581 IP 192.168.0.167.mdns > mdns.mcast.net.mdns: 0*- [0q] 1/0/0 (Cache flush) A 192.168.0.167 (45)
09:25:29.215590 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 AAAA (QM)? linux-lptp1.local. (35)
09:25:29.215746 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 AAAA (QM)? linux-lptp1.local. (35)
09:25:29.422304 IP6 linux-lptp1.local.mdns > ff02::fb.mdns: 0*- [0q] 1/0/0 (Cache flush) AAAA fe80::61f0:9af5:9c4c:6cc7 (57)
09:25:29.422304 IP 192.168.0.167.mdns > mdns.mcast.net.mdns: 0*- [0q] 1/0/0 (Cache flush) AAAA fe80::61f0:9af5:9c4c:6cc7 (57)
09:25:29.422304 IP 192.168.0.79.mdns > mdns.mcast.net.mdns: 0 [3q] PTR (QM)? _companion-link._tcp.local. PTR (QM)? _rdlink._tcp.local. PTR (QM)? lb._dns-sd._udp.local. (80)
09:25:29.422304 IP6 fe80::108f:ac4d:b4d7:1827.mdns > ff02::fb.mdns: 0 [3q] PTR (QM)? _companion-link._tcp.local. PTR (QM)? _rdlink._tcp.local. PTR (QM)? lb._dns-sd._udp.local. (80)
09:25:30.987012 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 4.4.3.8.9.8.7.9.6.d.a.b.b.2.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
09:25:30.987158 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 PTR (QM)? 4.4.3.8.9.8.7.9.6.d.a.b.b.2.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
09:25:30.987662 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0*- [0q] 1/0/0 (Cache flush) PTR dell-laptop.local. (115)
09:25:30.988195 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0*- [0q] 1/0/0 (Cache flush) PTR dell-laptop.local. (115)
09:25:31.162775 IP6 Android.local.mdns > ff02::fb.mdns: 175 [2q] PTR (QM)? _233637DE._sub._googlecast._tcp.local. PTR (QM)? _googlecast._tcp.local. (61)
09:25:31.162775 IP 192.168.0.45.mdns > mdns.mcast.net.mdns: 175 [2q] PTR (QM)? _233637DE._sub._googlecast._tcp.local. PTR (QM)? _googlecast._tcp.local. (61)
09:25:31.276275 IP6 dell-laptop.local.mdns > ff02::fb.mdns: 0 PTR (QM)? c.4.f.3.4.8.e.f.f.f.c.3.4.6.4.c.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
09:25:31.276375 IP 192.168.0.24.mdns > mdns.mcast.net.mdns: 0 PTR (QM)? c.4.f.3.4.8.e.f.f.f.c.3.4.6.4.c.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
09:25:31.368368 IP 192.168.0.45.mdns > mdns.mcast.net.mdns: 0*- [0q] 1/0/1 (Cache flush) PTR Android.local. (129)
09:25:31.368368 IP6 Android.local.mdns > ff02::fb.mdns: 0*- [0q] 1/0/1 (Cache flush) PTR Android.local. (129)
09:25:32.186630 IP6 Android.local.mdns > ff02::fb.mdns: 176 [2q] PTR (QM)? _233637DE._sub._googlecast._tcp.local. PTR (QM)? _googlecast._tcp.local. (61)
09:25:32.186630 IP 192.168.0.45.mdns > mdns.mcast.net.mdns: 176 [2q] PTR (QM)? _233637DE._sub._googlecast._tcp.local. PTR (QM)? _googlecast._tcp.local. (61)

You should observe similar activity. Of course NSS consults avahi-daemon and it should already have the host in question in the cache from a previous discovery.

Something else to check - examine the SOA record response with respect to your configured DNS server. I don’t expect it to be a problem but something else to eliminate…

host -t SOA local

It should respond like this

> host -t SOA local
Host local not found: 3(NXDOMAIN)

and nss-mdns requires this result in order to work.

Thank you! That was it!!

Turns out I did get a SOA record for .local.

$ host -t SOA local
local has SOA record localhost. root.localhost. 10 604800 86400 2419200 604800

After some digging it seems like it came from the default DNS provided by my internet provider Telenord. If I switched DNS to e.g. 8.8.8.8 then I got the expected

$ host -t SOA local
Host local not found: 3(NXDOMAIN)

and I can resolve hosts in .local!

Starting to understand the “It’s always DNS” meme now!

Thanks for the update. Glad to have helped expose the culprit.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.