I was surprised to see this error message in Chromium on Ubuntu 18.04 when trying to view an image in a post on a StackExchange site:
This site can’t be reached
i.stack.imgur.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
In an attempt to find out what was happening I tried to run tcpdump
to look at the DNS requests and responses. I attempted to reload the image giving me the error and this was the DNS traffic that I saw:
# tcpdump -pni any 'port 53'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
20:10:17.618041 IP 127.0.0.1.42714 > 127.0.0.53.53: 3068+ A? i.stack.imgur.com. (35)
20:10:17.618080 IP 127.0.0.1.42714 > 127.0.0.53.53: 23569+ AAAA? i.stack.imgur.com. (35)
20:10:17.618861 IP 127.0.0.53.53 > 127.0.0.1.42714: 3068 13/0/0 CNAME i.stack.imgur.com.cdn.cloudflare.net., A 104.16.0.35, A 104.16.26.34, A 104.16.2.35, A 104.16.30.34, A 104.16.28.34, A 104.16.24.34, A 104.16.25.34, A 104.16.29.34, A 104.16.27.34, A 104.16.3.35, A 104.16.1.35, A 104.16.31.34 (277)
20:10:17.619395 IP 127.0.0.53.53 > 127.0.0.1.42714: 23569| 16/0/0 CNAME i.stack.imgur.com.cdn.cloudflare.net., AAAA 2001:67c:2b0:db32:0:1:6810:1f22, AAAA 2001:67c:2b0:db32:0:1:6810:1b22, AAAA 64:ff9b::6810:23, AAAA 2001:67c:2b0:db32:0:1:6810:223, AAAA 2001:67c:27e4:64::6810:123, AAAA 64:ff9b::6810:1f22, AAAA 2001:67c:27e4:64::6810:1f22, AAAA 2001:67c:27e4:64::6810:223, AAAA 2001:67c:27e4:64::6810:1b22, AAAA 2001:67c:27e4:64::6810:1922, AAAA 2001:67c:2b0:db32:0:1:6810:1d22, AAAA 64:ff9b::6810:123, AAAA 2001:67c:2b0:db32:0:1:6810:1e22, AAAA 64:ff9b::6810:1822, AAAA 2001:67c:2b0:db32:0:1:6810:1822 (505)
As you can see the DNS resolution succeeded. But Chromium was still showing me the same NXDOMAIN error message. What could cause Chromium to report NXDOMAIN when the lookups were indeed successful?
See launchpad bugs 1804487 and 1805027 for the systemd-resolve problem. Workarounds
1) Add package libnss-resolve.
2) Use a nameserver directly in
/etc/resolve.conf
s link (or redirect link from/run/systemd/resolve/stub-resolve.conf
to/run/systemd/resolve/resolve.conf