Score:0

I am creating a home lab using VMs and routing internet but I cant resolve names?

mx flag

I have my first vm1 routing internet using iptables -A POSTROUTING -J MASQUERADE to second vm and vice versa on second VM my third VM can ping 1.1.1.1 (internet) and I set it a public DNS like 1.1.1.1 via network interfaces . Is there a fix , because if I can ping 1.1.1.1 and I set my DNS to 1.1.1.1 why cant I get name resoultions?

Bodo avatar
pt flag
What system (do you think) is 1.1.1.1? Is it running a name server which can resolve the names you try? Which names did you try to resolve? Show (copy&paste) the configuration instead of describing it. Please [edit] your question to add more details.
us flag
When you are running multiple machines you should consider a local DNS resolver
Score:0
br flag

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:

  1. The UDP port #53 traffic is blocked (filtered out or not allowed) anywhere in your VM cascade.
  2. The DNS server setting related to your VM network interface is not correct.
  3. 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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.