I am trying to resolve about 7000 URLs to IP addresses.
I have attempted multiple methods and I am trying to use powershell to query these addresses. I have used the below script, however my result keeps coming back empty.
Could you advise on whats wrong with the script or if there are better/other methods or tools I could use to resolve this. Thanks.
$hostnames = Get-Content "list.txt"
foreach($hostname in $hostnames){
$ip = ([System.Net.Dns]::GetHostAddresses($hostname)).IPAddressToString
write-host "$hostname : $ip"
I have attempted multiple methods and I am trying to use powershell to query these addresses. I have used the below script, however my result keeps coming back empty.
Could you advise on whats wrong with the script or if there are better/other methods or tools I could use to resolve this. Thanks.
$hostnames = Get-Content "list.txt"
foreach($hostname in $hostnames){
$ip = ([System.Net.Dns]::GetHostAddresses($hostname)).IPAddressToString
write-host "$hostname : $ip"