nsecx- NSEC[3] Walking for DNSSEC |
git clone git://git.acid.vegas/nsecx.git |
Log | Files | Refs | Archive | README | LICENSE |
commit d7c0c075c287ea7302bde9cd63c429de1777f122
parent 9238739c1e251ffe29c45c30e1b991a6f99567ac Author: acidvegas <acid.vegas@acid.vegas> Date: Mon, 6 Nov 2023 21:17:31 -0500 Pull the root tlds from a root nameserver instead Diffstat:
|
1 file changed, 8 insertions(+), 2 deletions(-) |
diff --git a/tldsec b/tldsec @@ -16,8 +16,14 @@ NC='\033[0m' # No Color # Create the output directory if it doesn't exist mkdir -p output -# Fetch the list of TLDs using curl -tld_list=$(curl -s "https://data.iana.org/TLD/tlds-alpha-by-domain.txt") +# Parse the tld list from a root nameserver (todo: randomize the root nameserver) +rndroot=$(dig AXFR . @a.root-servers.net | grep -E 'IN\s+NS' | awk '{print $1}' | sed 's/\.$//' | sort -u) +if [ -z $rndroot ]; then + echo "Failed to AXFR a root nameserver (using IANA list instead)" + tlds=$(curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | tail -n +2 | tr '[:upper:]' '[:lower:]') +else + tlds=$(echo | ) +fi # Check if the list was retrieved successfully if [ -z "$tld_list" ]; then |