powershell ip reverse resolution

Tagged as windows, powershell, dns
Written on 2017-01-27 15:22

A quick script to do reverse resolution of a textfile containing ips called ips.txt located in the same directory as the the file you put this content into:

$erroractionpreference = 'silentlycontinue'
get-content .\ips.txt | foreach-object {
        $resolvedip = [System.Net.Dns]::gethostentry($_).hostname
        echo "$_        : $resolvedip"

Save and execute. Might have some rough edges, this did not get much testing.


Unless otherwise credited all material Creative Commons License by sjas