SynopsisResolves a host name or IP address using DNS.
- Resolve-Host [-HostName]
DescriptionThe 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.
InputsResolve-Host accepts pipeline input for the HostName parameter and will attempt to resolve any objects passed to it.
OutputsResolve-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.
NotesThere are no notes associated with the Resolve-Host cmdlet.
Example 1This command will resolve www.vexasoft.com using the local computer's DNS client and return a host record object detailing the host name and resolved IP address:
Example 2Several 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 3Resolve-Host can be used to do reverse lookups, resolving IP addresses to host names:
Example 4Resolve-Host accepts pipeline input and will attempt to resolve any strings passed to it:
C:\PS>Get-Content .\ServerList.txt | Resolve-Host