Skip to content

Instantly share code, notes, and snippets.

@typhonius
Last active December 17, 2015 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typhonius/5550724 to your computer and use it in GitHub Desktop.
Save typhonius/5550724 to your computer and use it in GitHub Desktop.
gets the actual TTL rather than the TTL a user's machine has.
#!/bin/bash
if [ -z "${1}" ] ;
then
echo 'Please enter the address the TTL should be found for'
exit 1
fi
NS=`host -t NS $1 | awk {'print $4'}`
arr=$(echo $NS | tr " " "\n")
for x in $arr
do
dig @$x $1 +noall +answer
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment