/etc/resolv.conf pointing to dnsmasq instead of resolved
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Systemd sometimes just doesn't resolve DNS queries and for the life of me I don't know why.
So often when I'm switching between wifi networks I find that systemd-resolved in 17.10 complete fails to do it's job. Here's the example. I'm connected to the internet :
```
chalbersma@nebraska [~] {Tue Oct 31 20:58:18}
> ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=196 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=53 time=67.5 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=53 time=78.9 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 67.534/
```
But I can't seem to resolve domains:
```
chalbersma@nebraska [~] {Tue Oct 31 20:59:17}
> nslookup google.com
;; connection timed out; no servers could be reached
```
So I did a `systemd-resolver --status` to see if it's getting the right dns server. It is :
```
Link 3 (wlp2s0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.43.1
```
And it's actually up and working properly :
```
chalbersma@nebraska [~] {Tue Oct 31 21:02:06}
> nslookup google.com 192.168.43.1
Server: 192.168.43.1
Address: 192.168.43.1#53
Non-authoritative answer:
Name: google.com
Address: 172.217.11.78
chalbersma@nebraska [~] {Tue Oct 31 21:03:16}
> nslookup google.com 2001:4888:
Server: 2001:4888:
Address: 2001:4888:
Non-authoritative answer:
Name: google.com
Address: 172.217.11.78
```
Systemd just can't figure out to make the request. I did try the common step of flushing the cache (with `--flush-cache`) restarting network-manager and systemd-resolverd service but nothing seems to be able to make systemd-resolverd function. Even a reboot doesn't always fix the issue; sometimes it persists.
For debugging this is what's in my /etc/resolv.conf :
```
chalbersma@nebraska [~] {Tue Oct 31 21:09:15}
> cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 127.0.1.1
```
As soon as I manually set the nameserver from my loopback to the actual dns server (bypassing systemd-resolvd) things start working again. Let me know what kind of tshooting data I'd need to grab to help display this issue.
In order to restore networking I had to manually edit that file and change my dns to the external source.
information type: | Public → Public Security |
information type: | Public Security → Public |
Some more troubleshooting, I've found that if I manually set my nameserver to 127.0.0.53 systemd-resolver starts working again. However everytime that a wifi network connects or disconnects, it switches back to `127.0.0.1`
It does look like systemd-resolve only listens on that port too. :
`udp 0 0 127.0.0.53:53 0.0.0.0:* 858/systemd- resolve`
So what I need to find out is why network-manager isn't using the right settings for systemd-resolve.