[英]Get Azure FQDN (DNS Name) by Public IP Address
To get the FQDN for the VM I can do it with -VMName like:要获取 VM 的 FQDN,我可以使用 -VMName 来实现,例如:
$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):但我想用本地 IP 来做到这一点(所以不需要手动输入):
$vm = Get-AzVM -IP "20.X.X.15"
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 .据我所知,我们不能
IP address directly
来获取 Azure Vm 的 FQDN,首先我们需要检索PublicIP address
,然后才能获取 VM 的 FQDN 。
As you are using the correct command above:-当您使用上面的正确命令时:-
For more information please refer this Blog and as suggested @ Ken W MSFT in comment.有关更多信息,请参阅此博客,并按照@Ken W MSFT的建议在评论中发表评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.