Last active
July 22, 2016 21:03
-
-
Save peasead/dbff8df19b4dfed6b813 to your computer and use it in GitHub Desktop.
Simple script to loop through a list of IP addresses and output their resolutions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat ips.txt | while read ip | |
do | |
echo $ip " " & host $ip | cut -f 5 -d " " | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# just add 1 IP per line | |
192.168.1.1 | |
192.168.1.2 | |
192.168.1.3 | |
192.168.1.4 | |
192.168.1.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok, i was playing around with this a little more. and it really depends on the output of the commands on how easy this can be. i think this new version may work best.
Breakdown:
all in all, it's still a nice one-liner so you don't have to have a script file to run and it's pretty fast. output looks roughly like this:
10.11.12.13 NXDOMAIN
10.22.33.44 10-22-33-44.somedomain.net
10.44.22.55 10-44-22-55.someotherdomain.net specialsystem.domain.net
thanks!