Skip to content
Advertisement

Python, using basic unix command and list of hosts

I am trying to get the output of a list of hosts, using the unix command nslookup + the list of hosts, but I am getting an error although it does work when I only have one host.

Is there an easier way to do what I am doing or can you help me fix this simple script?

My script is:

JavaScript

Error:

JavaScript

Advertisement

Answer

Try this:

JavaScript

(http://linux.die.net/man/1/nslookup)

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement