0
votes

I have 2 VMs on the VNET in Azure.

The ports are open in the NSG.

I can access the ports when I use the IP address but I can't access them when I use the FQDM.

e.g.

nc -v -z -w2 10.1.2.4 8080
Connection to 10.1.2.4 8080 port [tcp/*] succeeded!

nc -v -z -w2 test.eastus.cloudapp.azure.com 8080
nc: connect to test.eastus.cloudapp.azure.com 8080 port 8080 (tcp) timed out: Operation now in progress

The VMs don't resolve the FQDN to IPs within the VNET.

What are my options?

3

3 Answers

0
votes

eastus.cloudapp.azure.com is a public DNS name which means communication routes outside of the Vnet. This means you need to add an NSG to allow traffic to port.

Image 1 https://i.imgur.com/2ZS71Pg.png

If VMs are on the same VNet and you are using Azure DNS (default) then you should be able to just use the VM name.

Example:

nc -v -z -w2 VM-hostname 8080

0
votes

the existing answer would work, or you could have a domain or a dns server inside the network or you could use Azure Private DNS for that.

0
votes

If you are trying to access the VM with its name internally, just do a Ipconfig/all and check the results.

enter image description here

You can use the DNS suffix along with the VM name. If you VM name is VM1, then you need to use this FQDN: VM1.bgoptsffxguutau1f5u032sm0g.gx.internal.cloudapp.net