- Remove
/etc/resolv.conf - Install dnsmasq:
sudo apt-get install dnsmasq - Disable and stop systemd-resolve (if currently being used):
sudo systemctl disable systemd-resolved.servicesudo systemctl stop systemd-resolved - Make sure
/etc/resolv.confis a link to/run/resolvconf/resolv.conf, which should just contain the linenameserver 127.0.0.1 - Edit
/etc/NetworkManager/NetworkManager.confto contain this line in[main]section:dns=dnsmasq - Restart the system to be on the safe side.
Now this should use the DNS nameservers NetworkManager received via DHCP. If you need to manually override it, you can edit
server=/dropbox.com/8.8.8.8
server=/dropboxapi.com/8.8.8.8
server=/google.com/8.8.8.8
server=/#/1.2.3.4
/etc/dnsmasq.conf, e.g. to override DNS servers from DHCP to resolve Dropbox and Google queries via Google' DNS 8.8.8.8, and fallback to 1.2.3.4 for all other domains:server=/dropbox.com/8.8.8.8
server=/dropboxapi.com/8.8.8.8
server=/google.com/8.8.8.8
server=/#/1.2.3.4