Sunday, 26 August 2018

Ubuntu 18.04 - how to lose 127.0.0.53

I dislike this automatic 127.0.0.53 DNS server you see by default in /etc/resolv.conf.  Whilst it works most of the time, it makes it hard to tell which upstream DNS servers are really in use. Fortunately I found a fix...


To lose 127.0.0.53 as the DNS, disable the systemd-resolved service and stop it:

sudo systemctl disable systemd-resolved.service
sudo service systemd-resolved stop

Put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

dns=default

Delete the symlink /etc/resolv.conf

rm /etc/resolv.conf

Restart network-manager

sudo service network-manager restart

The network connection make need to be taken down and up again to finally fix /etc/resolv.conf.  Check the settings in the Network Manager GUI too, of course.

No comments:

Post a comment

Spammers: please stop wasting my time. All comments are moderated before publication.