This cmdlet is part of the Vexasoft Cmdlet Library. You can click here to find out more.



Resolves a host name or IP address using DNS.


  • Resolve-Host [-HostName]


The Resolve-Host cmdlet is used to resolve host names or IP addresses using the local computer's DNS settings.


  • HostName The name or IP address to resolve.


Resolve-Host accepts pipeline input for the HostName parameter and will attempt to resolve any objects passed to it.


Resolve-Host returns a HostRecord object detailing the final resolved name and IP address of the requested host name. If the host name cannot be resolved, a host record is still returned, but with the missing information set to $null. If multiple IP addresses are registered to a single host name, multiple HostRecords are returned.


There are no notes associated with the Resolve-Host cmdlet.

Example 1

This command will resolve using the local computer's DNS client and return a host record object detailing the host name and resolved IP address:


Example 2

Several hosts can be specified at once to the cmdlet. This command will return host record objects with details of resolved IP addresses for PC01 and PC02:

C:\PS>Resolve-Host PC01, PC02

Example 3

Resolve-Host can be used to do reverse lookups, resolving IP addresses to host names:


Example 4

Resolve-Host accepts pipeline input and will attempt to resolve any strings passed to it:

C:\PS>Get-Content .\ServerList.txt | Resolve-Host