Help scripting dns lookup using awk

Tim Daneliuk tundra at
Fri Sep 15 01:58:46 UTC 2017

On 09/14/2017 07:55 PM, Ernie Luzar wrote:
> The following sh script works, but runs very slow.
Rudiments of the same thing in Python (spacing and indents matter):

#!/usr/bin/env python
# Return IP Of Hostnames Specified On Commandline

from socket import gethostbyname
from sys    import argv

for host in argv[1:]:
        print gethostbyname(host), " " * 8, host

        print "Invalid Hostname: %s" % host

Tim Daneliuk     tundra at
PGP Key:

More information about the freebsd-questions mailing list