J.D.
J.D.

Reputation: 55

Get Azure FQDN (DNS Name) by Public IP Address

To get the FQDN for the VM I can do it with -VMName like:

$vm = Get-AzVM -VMName "name"
$pubip = Get-AzPublicIpAddress -ResourceGroupName $vm.ResourceGroupName | where{$_.Id -match $vm.Name}

$pubip.DnsSettings.Fqdn

But I want to do this with the local IP like (so no manual input neccessary):

$vm = Get-AzVM -IP "20.X.X.15"

Upvotes: 1

Views: 1397

Answers (1)

AjayKumarGhose
AjayKumarGhose

Reputation: 4883

AFAIK, We can not use IP address directly to get the FQDN of Azure Vm, Firstly we need to retrieve the PublicIP address then after we can get the FQDN of the VM.

As you are using the correct command above:-

enter image description here

For more information please refer this Blog and as suggested @Ken W MSFT in comment.

Upvotes: 1

Related Questions