DNS Not working on Ubuntu VM

Richard Schmitt 5 Reputation points
2023-06-19T12:57:55.1366667+00:00

Not sure if this is specifically to "Azure DNS" but DNS configuration in general. I have two VMs and one Storage Account/Share. One VM is windows, one is Ubuntu. DNS works on my Windows VM. I can browse the internet and I can mount my storage share. DNS does not work on Ubuntu. I cannot resolve Internet URLs nor can I find my Azure storage server/share.

If I look at /run/systemd/resolve/resolve.conf it says:

nameserver 10.0.0.5
nameserver 10.0.0.4
search reddog.microsoft.com

My VM's IP Address is 10.0.0.6, so according to this, there should be a DNS server at 10.0.0.5 and 10.0.0.4. I can't ping either of those addresses from my VM.

This had been working at one point. I had an azure AD resource at one point but removed it because I don't think I was using it and it's an expensive resource. Do I need to configure an Azure DNS service? That wouldn't explain why Windows works. My Windows VM appears to have a Nameserver at ns1-05.azure-dns.com (13.107.236.5). Not only is my Ubuntu VM not configured with that address, it cannot even ping that address.

Anyone have any idea how DNS is supposed to be configured for a Ubuntu VM?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2023-06-20T17:20:31.16+00:00

    @Richard Schmitt

    The default DNS configuration for your Ubuntu VM will depend on the version of Ubuntu you are using as well as your VNET settings. The Azure DNS IP address is 168.63.129.16 and can be obtained via DHCP. I am sharing the Ubuntu 20.04 DNS settings for my VM in case it might be helpful to you or others.

    /etc/systemd/resolved.conf
    [Resolve]
    #DNS=
    #FallbackDNS=
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #DNSOverTLS=no
    #Cache=no-negative
    #DNSStubListener=yes
    #ReadEtcHosts=yes
    
    /etc/resolv.conf
    nameserver 127.0.0.53
    options edns0 trust-ad
    search uqqalz50zzjuhhb31pwfnbhtxb.xx.internal.cloudapp.net
    
    resolvectl status
    Link 2 (eth0)
          Current Scopes: DNS
    DefaultRoute setting: yes
           LLMNR setting: yes
    MulticastDNS setting: no
      DNSOverTLS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
      Current DNS Server: 168.63.129.16
             DNS Servers: 168.63.129.16
              DNS Domain: uqqalz50zzjuhhb31pwfnbhtxb.xx.internal.cloudapp.net
    

    If you want to use a custom DNS server I recommend configuring this in your VNET settings rather than apply this static configuration on your VMs. You can find more details about this in DNS Name Resolution options for Linux virtual machines in Azure and Name resolution for resources in Azure virtual networks.

    Hope this helps! Let me know if you have any follow-up questions or need further assistance.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.