Make a DNS resolution with PowerShell

Hello,

You can make a DNS resolution with PowerShell with a nice .Net class :

[System.Net.Dns]::GetHostByName(‘microsoft.com’)

System.Net.DNS.Resolve

The output is an object, so it’s “pipeable” and selectable.

You can have all the others methods with :

[System.Net.Dns] | Get-Member -Static

System.Net.DNS.StaticMethods

Be careful, some of them are “obsolete”, you can check that on MSDN :

http://msdn.microsoft.com/fr-fr/library/system.net.dns(v=vs.110).aspx

Leave a Reply