Created
July 12, 2019 07:14
-
-
Save chrosta/b52e63cab05c66b896f7f951adc33d1f to your computer and use it in GitHub Desktop.
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
for IP in $(cat IP.text | sort | uniq); do if [ $(nslookup $IP | egrep "^Name:" | wc -l) -eq "1" ]; then DN=$(nslookup $IP | egrep "^Name:" | sed 's/.*\ //g'); else DN="NA"; fi; echo "${IP//[$'\t\r\n']} ${DN//[$'\t\r\n']}"; done 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment