I have a couple of 18.04 VM's that all have the same problem: they do not seem to be using the correct DNS servers. These machines get their settings from DHCP, which looks like below:
$ netplan ip leases ens18
# This is private data. Do not parse.
ADDRESS=192.168.100.60
NETMASK=255.255.255.0
ROUTER=192.168.100.1
SERVER_ADDRESS=192.168.100.1
T1=3600
T2=6300
LIFETIME=7200
DNS=192.168.6.1 8.8.8.8
DOMAINNAME=my.domain
HOSTNAME=influx
CLIENTID=<redacted>
I have randomized the numbers above, but the point is that the DNS servers listed are the correct ones coming from DHCP. However, if I attempt name resolutions with nslookup I get the following:
$ nslookup
> test.my.domain
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find test.my.domain: NXDOMAIN
However, I can explicitly use the DNS server as such:
$ nslookup test.my.domain 192.168.6.1
Server: 192.168.6.1
Address: 192.168.6.1#53
Name: test.my.domain
Address: 192.168.100.150
Can anyone explain why it defaults to 127.0.0.53 and why name resolution isn't working?
It's worth noting I have 16.04 VM's running along side these in the same subnet and they do not have the same issue (they resolve and nslookup works as expected).