Whenever I restart my computer NetworkManager sets /etc/resolv.conf
to this, my DNS stops working and I get this error in Chrome.
/etc/resolv.conf
# Generated by NetworkManager
search tampabay.rr.com
nameserver 127.0.0.53
Chrome error:
DNS_PROBE_FINISHED_NO_INTERNET
I temporarily resolve the issue by setting /etc/resolv.conf
to this.
/etc/resolv.conf
nameserver 8.8.8.8
I'm guessing NetworkManager expects a DNS server on my local machine at 127.0.0.53, and I don't have DNS running there. How can I permanetly set 8.8.8.8
as my nameserver? If it's really neccessary how do I setup DNS at 127.0.0.53
?
I read man resolv.conf
but it didn't help me much.
I read this answer and created the file /etc/resolvconf/resolv.conf.d/tail
with nameserver 8.8.8.8
but it doesn't seem to have any effect: DNS set to systemd's 127.0.0.53 - how to change permanently?
Edit: Ubuntu 20.04 LTS
The DNS cache program unbound
was running on port :53 and preventing dnsmasq
from starting. I uninstalled unbound
and dnsmasq
starts now. However it's saying it's only running on 0.0.0.0 for some reason. I figure it has to be running on 127.0.0.1:53. I reinstalled dnsmasq but it's acting the same. /etc/dnsmasq.conf
is all commeted out.
On restart /etc/resolv.conf
is now set to
# Generated by resolvconf
nameserver 127.0.0.1
Not sure how to get dnsmasq
running properly.
/lib/systemd/system/dnsmasq.service
[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Requires=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
[Service]
Type=forking
PIDFile=/run/dnsmasq/dnsmasq.pid
# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/sbin/dnsmasq --test
# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
# wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "systemd-exec" function.
ExecStart=/etc/init.d/dnsmasq systemd-exec
# The systemd-*-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called like
# this to get correct error handling (ie don't start-resolvconf if the
# dnsmasq daemon fails to start.
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
journalctl -e --unit dnsmasq.service
-- Reboot --
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7349]: dnsmasq: syntax check OK.
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: started, version 2.80 cachesize 150
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: DNS service limited to local subnets
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: read /etc/hosts - 7 addresses
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts dnsmasq[7369]: no servers found in /run/dnsmasq/resolv.conf, will retry
Jul 08 23:41:54 phil-desktopubuntu-18-04-1-lts systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.