I have a strange problem resolving .local hosts on my linux (ubuntu) desktop. (I noticed that because my printer stops working. I figured out that the IP address of the printer is resolved using mdns which isn't working.) Then I tried to ping an other computer. The result is:
ping: zoe.local: Name or service not known
avahi-browse is able to resolve the IP address
= enp0s31f6 IPv4 zoe [xx:xx:xx:xx:xx:xx] Workstation local
hostname = [zoe.local]
address = [192.168.3.221]
port = [9]
txt = []
Then I checked the content of /etc/nsswitch.conf
. It looks normal.
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat systemd
group: compat systemd
shadow: compat
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname mymachines
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
/etc/resolv.conf is a symlink to /run/resolvconf/resolv.conf and the content seems to be standard:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
search intern
libnss-mdns is also installed.
On my second machine in the same network the .local address reolution works perfectly. Then I compared the two ping commands with strace. I figured out that the result of the systemd-resolved is different. I captured the traffic of the loopback interface. The interesting thing is that the systemd-resolvd reports a SOA for the .local domain. In the next step the address resolution asks my router for the .local address. This causes the error above.
The wireshark capture shows:
1 0.000000000 127.0.0.1 127.0.0.53 DNS 65 Standard query 0x70d2 SOA local
2 0.001437 127.0.0.53 127.0.0.1 DNS 113 Standard query response 0x459c SOA local SOA router.intern
The my second machine the local systemd resolver doesn't report a SOA and the mdns address resolutions works well.
1 0.000000000 127.0.0.1 127.0.0.53 DNS 65 Standard query 0x70d2 SOA local
2 0.027250385 127.0.0.53 127.0.0.1 DNS 65 Standard query response 0x70d2 No such name SOA local
I have tried to flush the dns cache with systemd-resolve --flush-caches
but it makes no differences.
It seems that the systemd-resolvd behaves very strange. Does anyone know whats going wrong here? Why answers the systemd-resolved with a SOA?
systemd-resolve --status
looks good to me:
Global
LLMNR setting: no
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Domain: intern
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 6 (vmnet8)
Current Scopes: none
DefaultRoute setting: no
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 5 (vmnet1)
Current Scopes: none
DefaultRoute setting: no
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 4 (virbr0-nic)
Current Scopes: none
DefaultRoute setting: no
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 3 (virbr0)
Current Scopes: none
DefaultRoute setting: no
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 2 (enp0s31f6)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 192.168.3.1
DNS Servers: 192.168.3.1
fe80::2a0:57ff:fe24:94c9
DNS Domain: ~.
intern