Score:0

Netplan: Setting DNS results in "Temporary failure in name resolution"

us flag

I have multiple VMs with static IPs configured over netplan. This works as expected, but when it comes to set the DNS it's not.

My local DNS is 192.168.2.1. If I enter it and try to ping Google/another Client via the hostname, it prints “Temporary failure in name resolution”.

But if I set it to 8.8.8.8 instead of 192.168.2.1, it can resolve Google and other external sites.

Some additional infos:

  • all my VMs are in 192.168.10.0
  • my main network for all non VMs is 192.168.2.0
  • the networks are correctly routed
  • all my Linux VMs are running Ubuntu Server 20.04 and are up-to-date (also tried older Ubuntu versions)
  • over DHCP everything works as expected
  • Windows VMs with static IPs and DNS are also working as expected

My Netplan config:

network:
  ethernets:
    enp7s0:
      dhcp4: false
      addresses:
        - 192.168.10.13/24
      gateway4: 192.168.10.1
      nameservers:
        addresses:
        - 192.168.2.1
        - 8.8.8.8
  version: 2

resolvectl status prints the following:

Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no                  
  Current DNS Server: 192.168.2.1         
         DNS Servers: 192.168.2.1         
          DNS Domain: lan                 
          DNSSEC NTA: 10.in-addr.arpa     
                      16.172.in-addr.arpa 
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa 
                      18.172.in-addr.arpa 
                      19.172.in-addr.arpa 
                      20.172.in-addr.arpa 
                      21.172.in-addr.arpa 
                      22.172.in-addr.arpa 
                      23.172.in-addr.arpa 
                      24.172.in-addr.arpa 
                      25.172.in-addr.arpa 
                      26.172.in-addr.arpa 
                      27.172.in-addr.arpa 
                      28.172.in-addr.arpa 
                      29.172.in-addr.arpa 
                      30.172.in-addr.arpa 
                      31.172.in-addr.arpa 
                      corp                
                      d.f.ip6.arpa        
                      home                
                      internal            
                      intranet            
                      lan                 
                      local               
                      private             
                      test                

Link 2 (enp7s0)
      Current Scopes: DNS        
DefaultRoute setting: yes        
       LLMNR setting: yes        
MulticastDNS setting: no         
  DNSOverTLS setting: no         
      DNSSEC setting: no         
    DNSSEC supported: no         
         DNS Servers: 192.168.2.1
                      8.8.8.8  

This is my network:

Network Plan

I have already tried different solutions, like modifying `/etc/systemd/resolv.conf, without success…

In the past year I had never problems about setting the DNS. The first difficulties came up two weeks ago with a newly created VM… Since there I got it never working again.

This is my first post here, so please tell me if I need to do something better or different ^^

Doug Smythies avatar
gn flag
Please tell us more about how the two sub-nets, 192.168.2.0/?? and 192.168.10.0/24 communicate with each other. You say "the networks are correctly routed", but please show us details.
us flag
I added my network config as Image. I am always able to ping the VMs from the client network over their IP. Same for VM to client.
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.