5

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$ 
patfla
  • 53
  • 1
  • 1
  • 5

4 Answers4

3

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

heynnema
  • 70,711
  • IIRC you also need to change the 'Method' from 'Automatic (DHCP)' to 'Automatic (DHCP) Addresses Only' using the dropdown – steeldriver Aug 22 '16 at 19:46
  • @heynema ok followed your instructions and am now waiting to see if the changes reflect on OpenDNS's stats pages. In the sense that the stats become non-zero. – patfla Aug 22 '16 at 20:47
  • OK. Just for fun, what does your resolv.conf look like now? In terminal, typing host -v www.buy.com, tells you what DNS server is responding? And if you do the same command a second time? Cheers, Al – heynnema Aug 22 '16 at 20:54
  • resolv.conf shows the correct addrs (208.67.220.220 and 208.67.222.222) and so does host -v www.buy.com. Illustrating a principle from many years of software engineering: bang away at it long enough and eventually it will work. – patfla Aug 22 '16 at 21:05
  • or... giggle... just ask for help from the right person... :-) – heynnema Aug 22 '16 at 21:44
  • Worked for me - had to disable and re-enable networking first though (through the network icon in the top panel) to apply the changes – mmey Feb 27 '17 at 15:32
0

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.

Marcos
  • 730
  • 1
  • 7
  • 26
0

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.

SAGAR Nair
  • 1,385
  • Thanks. Saw that but decided not to use it since I'd like the DNS server address to persist across reboots. – patfla Aug 22 '16 at 19:04
0

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.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
alex
  • 1
  • 1