Here's how I'd do it in PowerShell using a text file with one domain per line.
Get-Content domains.txt | %{
new-object -type PSObject -property @{
Domain=$_
IPAddr=[System.Net.Dns]::GetHostAddresses($_)
}
}
Which outputs something like:
Domain IPAddr
------ ------
www.google.com {2001:4860:4001:803::1011, 74.125.224.145, 74.125.224....
www.yahoo.com {2001:4998:c:401::c:9101, 2001:4998:c:401::c:9102, 200...
www.flickr.com {216.115.107.206, 67.195.141.201, 67.195.141.200, 98.1...
www.serverfault.com {64.34.119.12}
www.stackexchange.com {64.34.119.12}
Here's how I'd do it in Perl with the same text file.
perl -MSocket -nE 'chomp; say $_, " ", inet_ntoa "".gethostbyname $_;' domains.txt
Which outputs something like:
www.google.com 74.125.141.103
www.yahoo.com 72.30.38.140
www.flickr.com 216.115.107.206
www.serverfault.com 64.34.119.12
www.stackexchange.com 64.34.119.12