Sunday 26 August 2018

Ubuntu 18.04 - how to lose

I dislike this automatic 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 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:


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.