Unable to DNS resolve a host

Khaled AlAkhras 0 Reputation points
2024-03-25T20:30:45.9166667+00:00

Hello,

I have an Ubuntu VM (vm001) (10.0.0.9) that is part of Virtual Network that includes other VMs (vm002, vm003, ...) . I am unable to have other VMs resolve vm001 using DNS. vm001 is accessible using the IP address from the other VMs. Is there any command to force vm001 to be registered on the DNS server.

vm001> hostname -f
vm001

vm002> ping 10.0.0.9
PING 10.0.0.9 (10.0.0.9) 56(84) bytes of data.

64 bytes from 10.0.0.9: icmp_seq=1 ttl=64 time=2.46 ms

64 bytes from 10.0.0.9: icmp_seq=2 ttl=64 time=1.34 ms

vm002> ping vm001
ping: vm001: Temporary failure in name resolution

Thank you for your help.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
597 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Glen Rego 75 Reputation points Microsoft Employee
    2024-03-25T23:04:03.3566667+00:00

    Hello Khaled,

    Thank you for your questions. If you are using Azure-provided DNS, the appropriate DNS suffix will be automatically applied to your virtual machines. For all other options, you must either use Fully Qualified Domain Names (FQDN) or manually apply the appropriate DNS suffix to your virtual machines.User's image

    User's image

    I conducted a quick test in my lab, and it worked fine with Azure-provided DNS. If you are using custom DNS, Azure DNS private zones are the preferred solution, offering flexibility in managing your DNS zones and records. You can refer to this article that explains name resolution for resources in Azure virtual networks. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances?tabs=redhat


  2. Khaled AlAkhras 0 Reputation points
    2024-03-27T12:59:29.44+00:00

    Hello,

    Solved by changing the name of the VM to some dummy name and renaming back to the required name:

    vm001>sudo hostnamectl set-hostname vmtemp
    vm001>sudo reboot

    vmtemp>sudo hostnamectl set-hostname vm001
    vmtemp>sudo reboot

    0 comments No comments

  3. ChaitanyaNaykodi-MSFT 23,021 Reputation points Microsoft Employee
    2024-04-01T15:36:08.74+00:00

    @Khaled AlAkhras

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: You were unable to resolve the DNS name of the VM to it private IP address

    Solution:

    Solved by changing the name of the VM to some dummy name and renaming back to the required name:

    vm001>sudo hostnamectl set-hostname vmtemp

    vm001>sudo reboot

    vmtemp>sudo hostnamectl set-hostname vm001

    vmtemp>sudo reboot

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    PS: Just adding this statement for community benefit. Depending on the solution achieved, this issue might have been due stale DNS cache at the OS level and clearing the DNS cache for Ubuntu OS might have also helped resolve the issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments