Ping Azure VM in same subnet using VM name

2k views Asked by At

I have created 2 VMs ak-testvm-01 and ak-testvm-02 in the same subnet with the first VM having a static private IP of 10.0.0.4 and the second having a static private IP of 10.0.0.5.

I can ping one VM from the other using their IP addresses. But I am not able to ping one from the other using the VM name. i.e If I type ping ak-testvm-02 from ak-testvm-01, I get the error ping request could not find host.

What should I do to be able to ping one from the other using the VM name?

Thanks

1

There are 1 answers

0
Rick Rainey On BEST ANSWER

Name resolution between VM's (different cloud service) in the same virtual network is provided using a FQDN. Details on this and other name resolution scenarios is available here.

So, in your scenario, to ping ak-testvm-02 you need to provide the full DNS name which is ak-testvm-02.clouddapp.net. This ends up going through the Azure Load Balancer though which does not allow ping traffic.

This article describes using psping (from sysinternals) to perform a ping using one of the public endpoint ports on your VM, such as the Remote Desktop (RDP) or PowerShell endpoint that is added by default. So, if your RDP endpoint is on public port 62682 (for example), then you could use the following command:

psping ak-testvm-02.cloudapp.net:62682

The other option is to configure your own DNS server in your virtual network.