We have both Windows servers and Linux servers in the domain, and I would need to find the hostname based on ip address.
Currently I am using [System.Net.Dns]::gethostentry('10.254.254.254').HostName
to get the hostname. But this only work when target machine is windows machine. When the target machine is Linux machine, this powershell script doesn't work.
Can someone please help to advise how to use powershell to resolve IP address to hostname for Linux machine?
Thanks!