#!/bin/bash
show_help(){
echo Usage $0 domain
}
if [ -z "$1" ]; then
show_help
exit 1
fi
DOMAIN=$1
APEX_DOMAIN=`echo $DOMAIN | sed 's/\(.*\.\)\([^.]*\.[^.]*\)/\2/'`
FIRST_AUTHORITATIVE_NS=$(dig +nssearch $APEX_DOMAIN | awk '$1=="SOA"{sub(".$","",$2);print $2;exit;}')
echo
echo Using authoritative nameserver $FIRST_AUTHORITATIVE_NS
dig @$FIRST_AUTHORITATIVE_NS $@
Created
October 25, 2022 01:59
-
-
Save geraldvillorente/afa17e06966ce2098b25e338a73e0437 to your computer and use it in GitHub Desktop.
Get the TTL from the authoritative server
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output should be something like this