Why would Ubuntu treat NXDOMAIN as resolving to localhost?

Every time I should be getting an error because a domain does not exist (e.g. could not resolve host), I instead get an error about connecting to a loopback address:

$ curl -4 -v https://nonexist.invalid

The problem only starts occuring about 2 seconds after establishing a wireless connection. For a short time, all works as expected.

I am using systemd-resolved and dns appears to be working:

$ readlink /etc/resolv.conf
$ dig +short A example.com
$ dig +short A nonexist.invalid
$ systemd-resolve -t A nonexist.invalid
nonexist.invalid: resolve call failed: No appropriate name servers or networks for name found

If name resolution looks okay, why would programs still appear to be resolving names to

Go to Source
Author: anx