0

I have a Windows 7 Virtual Machine hosted on Azure with this public IP mymachinename.resourceplace.cloudapp.azure.com given by Azure portal. I use this address to connect with my machine through Windows Remote Desktop.

Now I ask you if there is a way (or a command) to know this string from inside the virtual machine itself.

1 Answer 1

0

It is not possible to get FQDN directly inside the VM.

FQDN is just a DNS name to point to the VM resource. It will work for any port you desire, once the appropriate Network Security Group rules are then created to allow the respective traffic to reach your VM.

However, you could use Azure PowerShell to get FQDN.

$ip=Get-AzureRmPublicIpAddress -ResourceGroupName <group name> -Name <Public IP address name>
$fqdn=$ip.DnsSettings.Fqdn
$fqdn

This is my test result.

enter image description here

4
  • I have read the Get-AzureRmPublicIpAddress API but when I run $ip=Get-AzureRmPublicIpAddress -ResourceGroupName myRemote -Name myRemote (yes, both the Resource Group Name and Virtual Machine has the same name) the PowerShell returns this error: Get-AzureRmPublicIpAddress : The Resource 'Microsoft.Network/publicIPAddresses/myRemote' under resource group 'myRemote' was not found. StatusCode: 404 ReasonPhrase: Not Found
    – Cyr
    Mar 27, 2017 at 8:35
  • Hi, please ensure your Public IP name is correct. According to your issue. It seems your public IP is not correct or existing. Mar 27, 2017 at 8:36
  • You could try to use Get-AzureRmPublicIpAddress -ResourceGroupName myRemote to get Public IP name Mar 27, 2017 at 8:41
  • I have found the mistake: I have used the Virtual Machine name instead of the public IP name (which in my case is "myRemote-ip"). With command $ip=Get-AzureRmPublicIpAddress -ResourceGroupName myRemote -Name myRemote-ip it works properly.
    – Cyr
    Mar 27, 2017 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .