Ubuntu 16.10: Avoid nameserver 127.0.0.53 in /etc/resolv.conf

This article will describe hot to avoid nameserver 127.0.0.53 in /etc/resolv.conf.

1 nameserver 127.0.0.53

After disabling NetworkManager dns=dnsmasq, the nameservers from DHCP server is written to /etc/resolv.conf. But invalid nameserver 127.0.0.53 is written to /etc/resolv.conf too.

This is provided by systemd-resolve and this prevents resolving host name.

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.11.2
nameserver 192.168.11.1
nameserver 127.0.0.53
search hiroom2.com

2 Disable systemd-resolved

Disable systemd-resolved and reboot. nameserver 127.0.0.53 is not written to /etc/resolv.conf.

$ sudo systemctl disable systemd-resolved
$ sudo reboot