On Ubuntu 16.04 I have Network Manager configured to automatically use an OpenVPN connection at system start-up. This works well.
However, when the machine resumes after being suspended, although the VPN reconnects, I am unable to browse (or ping) websites because host names cannot be resolved. For some reason DNS look-ups are failing.
ping: unknown host www.google.com
This only started happening a couple of weeks ago, I'm not sure what has changed.
Output of cat /etc/NetworkManager/NetworkManager.conf
:
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
Output of 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
Output of host -v www.apple.com
(before suspending):
Trying "www.apple.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41111
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 9, ADDITIONAL: 7
;; QUESTION SECTION:
;www.apple.com. IN A
;; ANSWER SECTION:
www.apple.com. 1287 IN CNAME www.apple.com.edgekey.net.
www.apple.com.edgekey.net. 1516 IN CNAME www.apple.com.edgekey.net.globalredir.akadns.net.
www.apple.com.edgekey.net.globalredir.akadns.net. 1516 IN CNAME e6858.dsce9.akamaiedge.net.
e6858.dsce9.akamaiedge.net. 20 IN A 104.94.190.92
;; AUTHORITY SECTION:
dsce9.akamaiedge.net. 1516 IN NS n3dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n1dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n6dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS a0dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n4dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n5dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n0dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n7dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n2dsce9.akamaiedge.net.
;; ADDITIONAL SECTION:
a0dsce9.akamaiedge.net. 1516 IN AAAA 2600:1480:e800::c0
n0dsce9.akamaiedge.net. 1516 IN A 88.221.81.194
n1dsce9.akamaiedge.net. 1516 IN A 23.62.100.157
n2dsce9.akamaiedge.net. 1516 IN A 95.101.2.121
n3dsce9.akamaiedge.net. 1516 IN A 95.101.79.79
n4dsce9.akamaiedge.net. 1516 IN A 23.62.100.159
n5dsce9.akamaiedge.net. 1516 IN A 23.62.100.164
Received 504 bytes from 127.0.1.1#53 in 66 ms
Trying "e6858.dsce9.akamaiedge.net"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60195
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 9, ADDITIONAL: 9
;; QUESTION SECTION:
;e6858.dsce9.akamaiedge.net. IN AAAA
;; ANSWER SECTION:
e6858.dsce9.akamaiedge.net. 20 IN AAAA 2a02:26f0:60:186::1aca
e6858.dsce9.akamaiedge.net. 20 IN AAAA 2a02:26f0:60:199::1aca
;; AUTHORITY SECTION:
dsce9.akamaiedge.net. 1516 IN NS n0dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n2dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n3dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS a0dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n4dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n1dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n5dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n6dsce9.akamaiedge.net.
dsce9.akamaiedge.net. 1516 IN NS n7dsce9.akamaiedge.net.
;; ADDITIONAL SECTION:
a0dsce9.akamaiedge.net. 1516 IN AAAA 2600:1480:e800::c0
n0dsce9.akamaiedge.net. 1516 IN A 88.221.81.194
n1dsce9.akamaiedge.net. 1516 IN A 23.62.100.157
n2dsce9.akamaiedge.net. 1516 IN A 95.101.2.121
n3dsce9.akamaiedge.net. 1516 IN A 95.101.79.79
n4dsce9.akamaiedge.net. 1516 IN A 23.62.100.159
n5dsce9.akamaiedge.net. 1516 IN A 23.62.100.164
n6dsce9.akamaiedge.net. 1516 IN A 23.62.100.165
n7dsce9.akamaiedge.net. 1516 IN A 23.62.100.166
Received 454 bytes from 127.0.1.1#53 in 29 ms
Trying "e6858.dsce9.akamaiedge.net"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44627
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;e6858.dsce9.akamaiedge.net. IN MX
;; AUTHORITY SECTION:
dsce9.akamaiedge.net. 600 IN SOA n0dsce9.akamaiedge.net. hostmaster.akamai.com. 1489520008 1000 1000 1000 1800
Received 109 bytes from 127.0.1.1#53 in 28 ms
Output of host -v www.apple.com
(after suspending):
Trying "www.apple.com"
;; connection timed out; no servers could be reached
terminal
output ofcat /etc/NetworkManager/NetworkManager.conf
andcat /etc/resolv.conf
andhost -v www.apple.com
. Show me the last command from before AND after suspend.dnsmasq
after a suspend? Does it work then?dnsmasq
but I found restartingnetwork-manager
would fix the problem sometimes but not every time. So I read through a few bug reports regarding network-manager, DNS and suspend. One commenter suggested downgrading the network-manager package withsudo apt install network-manager=1.2.2-0ubuntu0.16.04.4
andsudo apt-mark hold network-manager
so I've tried that as a workaround and so far so good.