PowerShell
PowerShell
DNS Lookup
Do a DNS lookup to resolve a hostname to an IP address.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
$socket = New-Object Chilkat.Socket
$maxWaitMs = 10000
$ipAddr = $socket.DnsLookup("www.chilkatsoft.com",$maxWaitMs)
if ($socket.LastMethodSuccess -ne $true) {
$($socket.LastErrorText)
exit
}
$("IP Address: " + $ipAddr)