Check for DNS record using PowerShell 2.0

powershell

Solution

You can try the GetHostEntry method:

[Net.DNS]::GetHostEntry("MachineName")

Another way would be to ping it using `Test-Connection` cmdlet, see this tip

Problem

What could be the best way to resolve a computer name apart from using: ``` [System.Net.DNS]::GetHostByName('MachineName').HostName ``` I dont want to import any specific DNS Modules.

Original source