DNS lookups on my Ubuntu 16.04 LTS workstation has recently gone crazy, and I don't know why. Every now and then it will start returning 10.0.0.1 for just about anything. For example, a few minutes ago, dig www.google.com
said:
; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15032
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 0 IN A 10.0.0.1
;; Query time: 0 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Jun 28 15:53:35 PDT 2017
;; MSG SIZE rcvd: 48
A few minutes later it started behaving normally again:
; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50042
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 122 IN A 216.58.195.228
;; Query time: 0 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Jun 28 15:55:11 PDT 2017
;; MSG SIZE rcvd: 59
It's flip-flopped a few times in the last several hours. I can't think of any changes I made that could have triggered this behavior.
Note that there is no 10.0.0.1 on my LAN. (it's all 192.168.0.x.)
I have tried rebooting my Ubuntu box and all of my network equipment and also changing the Network Connections >> IPv4 Settings >> Method to "Automatic (DHCP) addresses only", and manually setting DNS to 8.8.8.8, but It still sporadically switches to returning 10.0.0.1.
How do I debug (and fix) this issue?
Other info:
$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Oct 24 2016 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
$ 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
Update:
I just discovered that when this happens, my router's admin page is complaining that "Your ISP's DHCP does not function properly". I found a forum posting that mentioned that some ISPs apparently refuse to respond to new DHCPs requests, resulting in this error. I'd had some power outages recently (and also had to unplug some equipment when a UPS died), so I'm guessing these were related to this issue. It also seems that any time my router reboots (which is happens after practically any config change) there's about a 50% chance I'll get this error.
I'm still not sure where the 10.0.0.1
address is coming from. It turns out that even if I tell dig
which DNS server to use when my router is borked it'll return 10.0.0.1
:
# dig @8.8.8.8 www.yahoo.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @8.8.8.8 www.yahoo.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35485
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.yahoo.com. IN A
;; ANSWER SECTION:
www.yahoo.com. 0 IN A 10.0.0.1
;; Query time: 0 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Jun 29 11:10:14 PDT 2017
;; MSG SIZE rcvd: 47
I suspect that either my router or my ISP is intercepting outgoing DNS queries requests and returning these bogus responses, but I don't know how to confirm this.
ls -al /etc/resolv.conf
and if that's not conclusivecat /etc/resolv.conf
. Is your wifi router locked down? Is the period between switches roughly constant? – pbhj Jun 28 '17 at 23:30resolvconf
. It creates theresolv.conf
file on the fly by making that file just a link to it's own version. Now you need to know where resolvconf is getting its nameservers from - eg your router, so look atman resolvconf
and check the settings; also if it switches to the 10.0.0.1 setting trycat /etc/resolv.conf
again to catch more info. Also runsudo systemctl status dnsmasq.service systemd-resolved.service resolvconf.service
to see if you're running other resolvers that might be interfering (they're the main ones, there are probably others). – pbhj Jun 29 '17 at 01:31ping 10.0.0.1
you might want to usewireshark
to watch your wifi/ethernet traffic to see what's happening. Curiously this win 7 post describes the same issue. – pbhj Jun 29 '17 at 01:35/etc/NetworkManager/NetworkManager.conf
and see if your dns is also set to it, if yes removing it should fix your problem and assign your usual DNS from your network. – Ziazis Jun 29 '17 at 11:00resolvconf
's manpage indicates that it is told where to get nameservers from, rather than being confugured to know where they are. I don't know how to figure out what's telling it where the nameservers are.systemctl
only showsresolvconf.service
as active. – Laurence Gonsalves Jun 29 '17 at 17:21dns=dnsmasq
line from/etc/NetworkManager/NetworkManager.conf
? – Laurence Gonsalves Jun 29 '17 at 17:23service NetworkManager restart
seemed to fix the problem. Now the DNS is my actual DNS rather than the blackbox 127.0.1.1, which certainly helps with debugging. – Laurence Gonsalves Jun 29 '17 at 18:36