If you haven't seen this before, that's okay because I hadn't either:
[System.Net.Dns]::GetHostbyAddress($IP).HostName
The problem I have with this call is that it is mentally deprived. First, how can this be called without already knowing the IP address? It can't meaning, you already have a method to obtain the IP Address. Why would you want to bother getting the HostName?
[System.Net.Dns]::GetHostbyName("WIN-SEN3DGN4RRM").HostName
This returns my FQDN: WIN-SEN3DGN4RRM.Mary.Local
Same call but with a different property:
[System.Net.Dns]::GetHostbyName("WIN-SEN3DGN4RRM").AddressList[0].IPAddressToString
Returns: 10.1.10.14
No comments:
Post a Comment