The public DNS server 1.1.1.1 normally responds to requests from any nodes.
If you have no DNS response even though you get successful ping response from the address, there are three possible reasons:
- The UDP port #53 traffic is blocked (filtered out or not allowed) anywhere in your VM cascade.
- The DNS server setting related to your VM network interface is not correct.
- Your address translation provided by masquerade malforms the DNS requests/responses.
Do these tests on VM where DNS is not working. Copy & paste to a terminal window all 5 lines, then press Enter:
dig google.com
echo "-----------------"
dig google.com @1.1.1.1
echo "-----------------"
dig google.com @8.8.8.8
And repeat it using TCP protocol instead of UDP:
dig +tcp google.com
echo "-----------------"
dig +tcp google.com @1.1.1.1
echo "-----------------"
dig +tcp google.com @8.8.8.8
What is response of these command blocks? Do you get no response in all cases or positive one in at least one case? Please, copy and paste complete output here - edit your question.
Below is correct response example to first test.
- Search for the
SERVER
lines.
- Search for the
ANSWER
section and watch one line below it.
; <<>> DiG 9.16.15-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2334
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 213 IN A 142.251.36.142
;; Query time: 8 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: St úno 23 23:30:21 CET 2022
;; MSG SIZE rcvd: 55
-----------------
; <<>> DiG 9.16.15-Ubuntu <<>> google.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53083
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 253 IN A 142.251.37.110
;; Query time: 8 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: St úno 23 23:30:21 CET 2022
;; MSG SIZE rcvd: 55
-----------------
; <<>> DiG 9.16.15-Ubuntu <<>> google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5872
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 25 IN A 216.58.201.78
;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: St úno 23 23:30:21 CET 2022
;; MSG SIZE rcvd: 55
The first block contains the dig google.com response when your DNS setting in the VM is used. The IP address 127.0.0.1 of the DNS server should be present. It's your local system address (loopback). This is normal for new Ubuntu distributions with default settings related to Netplan & Network Manager. It is test of your DNS setting.
The second and third blocks contains the responses when other then local DNS servers are used. Both queries go directly to the specified public DNS servers and verifies the remote DNS server functionality as well as the free way for the DNS traffic between the servers and your VM.