Ubuntu 18.04 desktop upgraded from 16.04. I have a strange problem that I can't solve.
After upgrading, I continued doing the network config as I always have (interfaces, resolv, ...) before I noticed the switch to netplan. Now I'm trying to be good and change it but I must have messed something up.
After a reboot or "systemctl restart systemd-networkd" everything is fine. nslookup works for both WAN and LAN. But after a while, LAN lookup stops working and as far as I can see, nothing has changed.
diskstation (192.168.0.42) is my NAS which is the local DNS.
After restart:
nslookup diskstation.lan
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: diskstation.lan
Address: 192.168.0.42A while later (without me doing anything):
nslookup diskstation.lan
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find diskstation.lan: NXDOMAINBut this works:
nslookup diskstation.lan 192.168.0.42
Server: 192.168.0.42
Address: 192.168.0.42#53
Name: diskstation.lan
Address: 192.168.0.42My netplan file 01-netcfg.yaml
network: version: 2 renderer: networkd ethernets: enp33s0: dhcp4: no addresses: - 192.168.0.46/24 gateway4: 192.168.0.1 nameservers: search: [lan] addresses: [192.168.0.42, 8.8.8.8, 8.8.4.4]Resolve status:
systemd-resolve --status
Global DNS Domain: lan 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 3 (docker0) Current Scopes: none LLMNR setting: yes
MulticastDNS setting: no DNSSEC setting: no DNSSEC supported: no
Link 2 (enp33s0) Current Scopes: DNS LLMNR setting: yes
MulticastDNS setting: no DNSSEC setting: no DNSSEC supported: no DNS Servers: 192.168.0.42 8.8.8.8 8.8.4.4 DNS Domain: lanThe strange thing is that nothing have changed when it stops working.
I did a find / -mmin -60 and no changes.
Status output (from resolve for example) doesn't change either.
ifconfig
enp33s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.46 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::329c:23ff:fe00:5fd8 prefixlen 64 scopeid 0x20<link> ether 30:9c:23:00:5f:d8 txqueuelen 1000 (Ethernet) RX packets 2925377 bytes 3969527143 (3.9 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1245146 bytes 143284968 (143.2 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 218578 bytes 19744358 (19.7 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 218578 bytes 19744358 (19.7 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0Here it is:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
un dnsmasq <none> <none> (no description available)
ii dnsmasq-base 2.79-1 amd64 Small caching DNS proxy and DHCP/TFTP server
un dnsmasq-base-lua <none> <none> (no description available) 1 1 Answer
You have listed both a private nameserver and public nameservers in your config, and these do not have the same view of DNS. Since you have a stateful local resolver (resolved), if your first DNS server is temporarily unavailable for any reason (simply meaning that it didn't answer in time), resolution falls back to the next server in the list, which is a public name server which doesn't know about your local names.
To avoid this, you should use only private nameservers in your config without a public fallback.