Ubuntu 16.04.1 tells me my DNS server is 127.0.0.1

Which isn't very useful. (yes that's the local node).

I'm trying to switch from the DNS server address hardcoded into a new Comcast router to OpenDNS configured onto a secondary home wifi router and I'd like to check the result. I've logged into opendns.com and checked the stats but have found no traffic.

patfla@patfla-N550JV:/etc/network$ nslookup google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: google.com
Address: 216.58.195.238
patfla@patfla-N550JV:/etc/network$ cat /etc/resolv.conf
# 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 127.0.1.1
search SECONDARY-ROUTER-NAME
patfla@patfla-N550JV:/etc/network$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
wireless-essid Blah <- this hardwires me to use the secondary router
patfla@patfla-N550JV:/etc/network$ 

4 Answers

Put /etc/NetworkManager/NetworkManager.conf back to its original setting.

Don't edit /etc/resolv.conf.

Instead, go to the network icon in the top panel, and select Edit Connections. Assuming that you're using an ethernet connect to your computer, edit the script called Wired Connection. Select the IPV4 tab, change the 'Method' from 'Automatic (DHCP)' to 'Automatic (DHCP) Addresses Only' using the dropdown, and enter your desired DNS servers, comma-separated, into the box DNS Servers.

You can also enter the new DNS server information directly into your wifi router.

Cheers, Al

6

change the nameserver in /etc/resolv.conf to required to test it. Say vim /etc/resolv.conf

#nameserver 127.0.1.1
nameserver 8.8.8.8

This settings will be automatically cleared off on the very next reboot.

1

I had the the same problem on Xubuntu 17.04. After each boot up I could not go online, because there was the line nameserver 127.0.0.1 in my /etc/resolv.conf. Editing /etc/resolv.conf helped to get online but the file could not be overwritten. So after a reboot I had exactly the same problem.

My workaround was:

  1. sudo systemctl disable systemd-resolved.service
  2. sudo service network-manager restart && service networking restart

(after it there were the right DNS Server-IP's in the /etc/resolv.conf ; just cat /etc/resolv.conf`` aftersudo service network-manager restart && service networking restart` and look if it's right)

  1. sudo systemctl enable systemd-resolved.service
  2. reboot & enjoy. the resolv.conf's dns-addresses have been changed to the right ones.

p.s. don't edit /etc/resolv.conf anymore. if you want to look if it has the right IP's, please use cat. otherwise it can happen, that after reboot you have nameserver 127.0.0.1' there again.

Rather than working around outside how NetworkManager and resolvconf work,

I just created/edited

 /etc/resolvconf/resolv.conf.d/tail

with

nameserver 1.1.1.1

Then just run

resolvconf -u

to regenerate /etc/resolv.conf.
Just keep in mind that all network interfaces will see and try to use those, even offline ones.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like