Created
November 2, 2015 07:33
-
-
Save jubstuff/6b86998c98fc40ca86be to your computer and use it in GitHub Desktop.
Revisions
-
jubstuff created this gist
Nov 2, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash # Use this script to check which of the domains contained in file are pointing to the # given domain # Credits: https://www.euperia.com/linux/howto-get-the-ip-address-of-a-domain-in-a-one-liner/385 # and various Stackoverflow users ^_^ if [ $# -eq 0 ]; then echo "Usage ${0##*/} path/to/file domain" exit 0 fi file="$1" domain="$2" while read line; do if dig +short A ${line} | grep -q $2; then echo $line fi done <$file