I'm trying to get dnsmasq working on Xubuntu 17.04 with NetworkManager. So I have this NetworkManager.conf, which is default except for the dns=dnsmasq line added by me -
Code:
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns=dnsmasq
[ifupdown]
managed=false
Then I disabled systemd-resolved, to make sure it wouldn't be used instead of dnsmasq -
Code:
$ sudo systemctl stop systemd-resolved
$ sudo systemctl disable systemd-resolved
Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service.
Rebooted for good measure...and I have no DNS. Well, actually, that's not quite accurate, as this works fine -
Code:
$ dig @127.0.1.1 noscript.net
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @127.0.1.1 noscript.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30813
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;noscript.net. IN A
;; ANSWER SECTION:
noscript.net. 76402 IN A 82.103.134.102
;; Query time: 7 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: xxxxxxxxxxxxxxxxxxxxxxxx
;; MSG SIZE rcvd: 46
Where 127.0.1.1 is the IP address on which dnsmasq is listening.
I think the problem is that /run/resolvconf/resolv.conf does not point to dnsmasq -
Code:
$ cat /run/resolvconf/resolv.conf
# 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.
For comparison, this is what that file looks like in 16.04, where DNS with dnsmasq does work -
Code:
$ cat /run/resolvconf/resolv.conf
# 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
nameserver 127.0.1.1
But I don't know anything about how that file is generated, or what generates it. So I'm not sure where to look next.
How to get dnsmasq DNS working in 17.04?
I should mention, there are two reasons I'd like to get this working -
1) I have a highly customised dnsmasq setup, which I can't afford to lose after upgrading beyond 16.04.
2) I'm trying to run the 17.04 version of NetworkManager on 16.04. And while the newer NetworkManager compiles and runs fine on 16.04, it gives this same problem there too. So backwards-compatibility in solutions, if possible, would be much appreciated.