However, I followed it as much as I could, but still wasn't able to properly replace systemd-resolved with dnsmasq --
If i put
/etc/NetworkManager/NetworkManager.conf, then the
nameserver in my
/etc/resolv.conf will be my ISP's, not my
dnsmasq. If removing it, then the
nameserver in my
/etc/resolv.conf will remain to be
So all in all, how to properly use dnsmasq as system DNS service?
- I've removed
resolvconf, and now the question is,
- how to replace systemd-resolved with dnsmasq?
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic
I've actually tried two time, with the latest attempt from a fresh Lubuntu 18.04.2 LTS installation, and both cases did not work. By "did not work" I meant I can see
dnsmasq is listening on '
dig cnn.com and/or any DNS query times out.
Here are the updated info. Note that I've reverted my changes and am now back to using systemd-resolved. So results like
grep -i stub /etc/systemd/resolved.conf reflect my current stage (back to
$ dpkg -l '*dnsmasq*' 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 +++-===================-==============-==============-=========================================== ii dnsmasq 2.79-1 all Small caching DNS proxy and DHCP/TFTP serve ii dnsmasq-base 2.79-1 amd64 Small caching DNS proxy and DHCP/TFTP serve un dnsmasq-base-lua <none> <none> (no description available) ii dnsmasq-utils 2.79-1 amd64 Utilities for manipulating DHCP leases $ ls -al /etc/resolv.conf lrwxrwxrwx 1 root root 35 2019-07-14 22:07 /etc/resolv.conf -> /var/run/NetworkManager/resolv.conf $ grep -i stub /etc/systemd/resolved.conf #DNSStubListener=yes $ cat /etc/NetworkManager/NetworkManager.conf [main] plugins=ifupdown,keyfile [ifupdown] managed=false [device] wifi.scan-rand-mac-address=no # I've removed `resolvconf`: $ dpkg -l '*resolvconf*' 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 resolvconf <none> <none> (no description available) $ sudo ls /run/resolvconf/resolv.conf ls: cannot access '/run/resolvconf/resolv.conf': No such file or directory
I now think I know what went wrong -- after the change (following all the steps in the answer), I checked the content of
/etc/resolv.conf, and found its content remains the same. I.e., still having
Now I recall that
nameserver 127.0.0.53 is for
systemd-resolved, whereas for
dnsmasq, it should be
nameserver 127.0.0.1. That's why all DNS queries are timing out.
I.e., there is one step missing from the answer, which is to change
/etc/resolv.conf, which I don't know how.