Can't get Ubuntu 22.04 server to resolve names
https://askubuntu.com/questions/1484577/cant-get-ubuntu-22-04-server-to-resolve-names
I installed Ubuntu 22.04 and I setup the interface my server has with an IP and DNS servers that it is supposed to use:
root@m15jumplnxnoc01v:/# cat /etc/netplan/00-installer-config.yaml
network:
ethernets:
ens160:
dhcp4: no
addresses:
- 10.248.0.235/24
routes:
- to: default
via: 10.248.0.1
nameservers:
addresses:
- 10.248.0.100
- 10.248.0.103
version: 2
After getting the interface configured and working, I confirmed that I was able to ping 8.8.8.8, but I couldn't get nslookup to resolve www.google.com
So I went ahead and added the DNS servers globally by adding them to the file /etc/systemd/resolved.conf and restarting the service:
[Resolve]
DNS=10.248.0.100 10.248.0.103
FallbackDNS=8.8.8.8
Domains=~.
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
That didn't resolve my problem, although I was able to see both the global and interface DNS servers properly set:
root@m15jumplnxnoc01v:/# resolvectl
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 10.248.0.103
DNS Servers: 10.248.0.100 10.248.0.103
Fallback DNS Servers: 8.8.8.8
DNS Domain: ~.
Link 2 (ens160)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 10.248.0.100
DNS Servers: 10.248.0.100 10.248.0.103
But I'm still getting an error reporting "time outs" to the DNS servers:
root@m15jumplnxnoc01v:/# nslookup www.google.com
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; no servers could be reached
The interesting things is that the connectivity is indeed in place:
root@m15jumplnxnoc01v:/# nc -uvz 172.0.0.53 53
Connection to 172.0.0.53 53 port [udp/domain] succeeded!
root@m15jumplnxnoc01v:/# nc -uvz 10.248.0.100 53
Connection to 10.248.0.100 53 port [udp/domain] succeeded!
root@m15jumplnxnoc01v:/# nc -uvz 10.248.0.103 53
Connection to 10.248.0.103 53 port [udp/domain] succeeded!
root@m15jumplnxnoc01v:/# nc -uvz 8.8.8.8 53
Connection to 8.8.8.8 53 port [udp/domain] succeeded!
I did a tcpdump looking for UDP/53 traffic, and I do see the requests going to the right servers:
root@m15jumplnxnoc01v:/# tcpdump -nni any udp and port 53
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
17:33:25.372379 lo In IP 127.0.0.1.43642 > 127.0.0.53.53: 4933+ [1au] A? detectportal.firefox.com. (53)
17:33:25.372418 lo In IP 127.0.0.1.43642 > 127.0.0.53.53: 34751+ [1au] AAAA? detectportal.firefox.com. (53)
17:33:26.008362 lo In IP 127.0.0.1.42621 > 127.0.0.53.53: 45529+ [1au] A? ntp.ubuntu.com. (43)
17:33:26.008405 lo In IP 127.0.0.1.42621 > 127.0.0.53.53: 32209+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:30.012481 lo In IP 127.0.0.1.38425 > 127.0.0.53.53: 5001+ A? www.google.com. (32)
17:33:30.377639 lo In IP 127.0.0.1.45370 > 127.0.0.53.53: 62098+ [1au] A? detectportal.firefox.com. (53)
17:33:30.377837 lo In IP 127.0.0.1.45370 > 127.0.0.53.53: 5017+ [1au] AAAA? detectportal.firefox.com. (53)
17:33:31.013169 lo In IP 127.0.0.1.39636 > 127.0.0.53.53: 1505+ [1au] A? ntp.ubuntu.com. (43)
17:33:31.013201 lo In IP 127.0.0.1.39636 > 127.0.0.53.53: 19416+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:35.016648 lo In IP 127.0.0.1.54656 > 127.0.0.53.53: 5001+ A? www.google.com. (32)
17:33:35.383028 lo In IP 127.0.0.1.45370 > 127.0.0.53.53: 62098+ [1au] A? detectportal.firefox.com. (53)
17:33:35.383062 lo In IP 127.0.0.1.45370 > 127.0.0.53.53: 5017+ [1au] AAAA? detectportal.firefox.com. (53)
17:33:36.018367 lo In IP 127.0.0.1.39636 > 127.0.0.53.53: 1505+ [1au] A? ntp.ubuntu.com. (43)
17:33:36.018411 lo In IP 127.0.0.1.39636 > 127.0.0.53.53: 19416+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:40.022204 lo In IP 127.0.0.1.41749 > 127.0.0.53.53: 5001+ A? www.google.com. (32)
17:33:41.020464 lo In IP 127.0.0.1.48022 > 127.0.0.53.53: 27022+ [1au] A? ntp.ubuntu.com. (43)
17:33:41.020506 lo In IP 127.0.0.1.48022 > 127.0.0.53.53: 51079+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:46.025666 lo In IP 127.0.0.1.48022 > 127.0.0.53.53: 27022+ [1au] A? ntp.ubuntu.com. (43)
17:33:46.025709 lo In IP 127.0.0.1.48022 > 127.0.0.53.53: 51079+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:46.026381 ens160 Out IP 10.248.0.235.34103 > 10.248.0.100.53: 35474+ A? detectportal.firefox.com. (42)
17:33:46.026533 ens160 Out IP 10.248.0.235.33402 > 10.248.0.100.53: 40994+ A? ntp.ubuntu.com. (32)
17:33:46.026700 ens160 Out IP 10.248.0.235.60090 > 10.248.0.100.53: 36947+ AAAA? ntp.ubuntu.com. (32)
17:33:46.026813 ens160 Out IP 10.248.0.235.33960 > 10.248.0.100.53: 10092+ A? www.google.com. (32)
17:33:46.026930 ens160 Out IP 10.248.0.235.39671 > 10.248.0.100.53: 26888+ AAAA? detectportal.firefox.com. (42)
17:33:51.028884 lo In IP 127.0.0.1.39871 > 127.0.0.53.53: 58427+ [1au] A? ntp.ubuntu.com. (43)
17:33:51.028924 lo In IP 127.0.0.1.39871 > 127.0.0.53.53: 14641+ [1au] AAAA? ntp.ubuntu.com. (43)
17:33:51.029477 ens160 Out IP 10.248.0.235.42022 > 10.248.0.103.53: 26888+ AAAA? detectportal.firefox.com. (42)
17:33:51.029655 ens160 Out IP 10.248.0.235.34400 > 10.248.0.103.53: 10092+ A? www.google.com. (32)
17:33:51.029776 ens160 Out IP 10.248.0.235.38663 > 10.248.0.103.53: 36947+ AAAA? ntp.ubuntu.com. (32)
17:33:51.029894 ens160 Out IP 10.248.0.235.58453 > 10.248.0.103.53: 40994+ A? ntp.ubuntu.com. (32)
17:33:51.030040 ens160 Out IP 10.248.0.235.51256 > 10.248.0.103.53: 35474+ A? detectportal.firefox.com. (42)
17:33:56.032396 lo In IP 127.0.0.1.39871 > 127.0.0.53.53: 58427+ [1au] A? ntp.ubuntu.com. (43)
17:33:56.032440 lo In IP 127.0.0.1.39871 > 127.0.0.53.53: 14641+ [1au] AAAA? ntp.ubuntu.com. (43)
17:34:00.365067 lo In IP 127.0.0.1.44129 > 127.0.0.53.53: 8050+ [1au] A? detectportal.firefox.com. (53)
17:34:00.365104 lo In IP 127.0.0.1.44129 > 127.0.0.53.53: 4987+ [1au] AAAA? detectportal.firefox.com. (53)
17:34:01.036519 lo In IP 127.0.0.1.34244 > 127.0.0.53.53: 36036+ [1au] A? ntp.ubuntu.com. (43)
17:34:01.036568 lo In IP 127.0.0.1.34244 > 127.0.0.53.53: 59855+ [1au] AAAA? ntp.ubuntu.com. (43)
^C
37 packets captured
64 packets received by filter
0 packets dropped by kernel
I even tried changing the DNS service to resolvconf and editing the config file /etc/resolvconf/resolv.conf.d/head to add the DNS servers there, and dnsmasq and adding the DNS serves to /etc/resolv.conf (which is what dnsmasq uses).
No matter which service I try or how I configure it it keeps timing out, but the connectivity is definitely there as shown above.
Any idea on what else can I check?
Thanks in advance!