Using PowerShell to Perform a Reverse DNS Lookup in Active Directory

Typically, one would use ping -a to get the hostname for a specific IP address which performs a DNS reverse lookup.
Querying AD for a computer with an IP works great for computers joined to the Active Directory domain since most computers in AD have the IP Address configured on the computer account. When the computer is joined to the domain, there are several attributes populated which are updated periodically, such as ipv4address, operatingsystem, operatingsystemversion, servicepack, etc.

Perform a IP Lookup Using PowerShell to find the associated computer (AD cmdlets):
import-module activedirectory
$ComputerIPAddress = ‘’
Get-ADComputer -property * -filter { ipv4address -eq $ComputerIPAddress }

Perform a DNS Reverse Lookup (IP to hostname) Using PowerShell (.Net):

$ComputerIPAddress = ‘’

Get IP from Hostname Using PowerShell (.Net):
$ComputerName= ‘MetcorpDC01’


(Visited 59,005 times, 1 visits today)