Created
August 11, 2024 21:51
-
-
Save tyzbit/61db8dfb926ad6b8ef67504470cf43ec to your computer and use it in GitHub Desktop.
script to check a domain name against all cloudflare TLDs
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
#!/bin/bash | |
cloudflare_supported_tlds=( | |
"academy" | |
"accountant" | |
"accountants" | |
"actor" | |
"agency" | |
"apartments" | |
"app" | |
"associates" | |
"attorney" | |
"auction" | |
"band" | |
"bar" | |
"bargains" | |
"beer" | |
"bet" | |
"bid" | |
"bike" | |
"bingo" | |
"biz" | |
"black" | |
"blog" | |
"blue" | |
"boo" | |
"boston" | |
"boutique" | |
"broker" | |
"builders" | |
"business" | |
"cab" | |
"cafe" | |
"cam" | |
"camera" | |
"camp" | |
"capital" | |
"cards" | |
"care" | |
"careers" | |
"casa" | |
"cash" | |
"casino" | |
"catering" | |
"cc" | |
"center" | |
"ceo" | |
"chat" | |
"cheap" | |
"church" | |
"city" | |
"claims" | |
"cleaning" | |
"clinic" | |
"clothing" | |
"cloud" | |
"club" | |
"co.uk" | |
"co" | |
"coach" | |
"codes" | |
"coffee" | |
"college" | |
"com.co" | |
"com" | |
"community" | |
"company" | |
"compare" | |
"computer" | |
"condos" | |
"construction" | |
"consulting" | |
"contact" | |
"contractors" | |
"cooking" | |
"cool" | |
"coupons" | |
"credit" | |
"creditcard" | |
"cricket" | |
"cruises" | |
"dad" | |
"dance" | |
"date" | |
"dating" | |
"day" | |
"deals" | |
"degree" | |
"delivery" | |
"democrat" | |
"dental" | |
"dentist" | |
"design" | |
"dev" | |
"diamonds" | |
"digital" | |
"direct" | |
"directory" | |
"discount" | |
"doctor" | |
"dog" | |
"domains" | |
"download" | |
"education" | |
"email" | |
"energy" | |
"engineer" | |
"engineering" | |
"enterprises" | |
"equipment" | |
"esq" | |
"estate" | |
"events" | |
"exchange" | |
"expert" | |
"exposed" | |
"express" | |
"fail" | |
"faith" | |
"family" | |
"fans" | |
"farm" | |
"fashion" | |
"finance" | |
"financial" | |
"fish" | |
"fishing" | |
"fit" | |
"fitness" | |
"flights" | |
"florist" | |
"fm" | |
"foo" | |
"football" | |
"forex" | |
"forsale" | |
"foundation" | |
"fun" | |
"fund" | |
"furniture" | |
"futbol" | |
"fyi" | |
"gallery" | |
"games" | |
"garden" | |
"gifts" | |
"gives" | |
"glass" | |
"gmbh" | |
"gold" | |
"golf" | |
"graphics" | |
"gratis" | |
"green" | |
"gripe" | |
"group" | |
"guide" | |
"guru" | |
"haus" | |
"health" | |
"healthcare" | |
"hockey" | |
"holdings" | |
"holiday" | |
"horse" | |
"hospital" | |
"host" | |
"house" | |
"how" | |
"immo" | |
"immobilien" | |
"industries" | |
"info" | |
"ink" | |
"institute" | |
"insure" | |
"international" | |
"investments" | |
"io" | |
"irish" | |
"jetzt" | |
"jewelry" | |
"kaufen" | |
"kim" | |
"kitchen" | |
"land" | |
"lawyer" | |
"lease" | |
"legal" | |
"lgbt" | |
"life" | |
"lighting" | |
"limited" | |
"limo" | |
"live" | |
"loan" | |
"loans" | |
"love" | |
"ltd" | |
"luxe" | |
"maison" | |
"management" | |
"market" | |
"marketing" | |
"markets" | |
"mba" | |
"me.uk" | |
"me" | |
"media" | |
"memorial" | |
"men" | |
"miami" | |
"mobi" | |
"moda" | |
"money" | |
"mortgage" | |
"mov" | |
"movie" | |
"net.co" | |
"net.uk" | |
"net" | |
"network" | |
"new" | |
"news" | |
"nexus" | |
"ninja" | |
"nom.co" | |
"observer" | |
"online" | |
"org.uk" | |
"org" | |
"page" | |
"partners" | |
"parts" | |
"party" | |
"pet" | |
"phd" | |
"photography" | |
"photos" | |
"pictures" | |
"pink" | |
"pizza" | |
"place" | |
"plumbing" | |
"plus" | |
"press" | |
"pro" | |
"productions" | |
"prof" | |
"promo" | |
"properties" | |
"pub" | |
"racing" | |
"radio.fm" | |
"realty" | |
"recipes" | |
"red" | |
"rehab" | |
"reise" | |
"reisen" | |
"rent" | |
"rentals" | |
"repair" | |
"report" | |
"republican" | |
"rest" | |
"restaurant" | |
"review" | |
"reviews" | |
"rip" | |
"rocks" | |
"rodeo" | |
"rsvp" | |
"run" | |
"sale" | |
"salon" | |
"sarl" | |
"school" | |
"schule" | |
"science" | |
"security" | |
"select" | |
"services" | |
"shoes" | |
"shopping" | |
"show" | |
"singles" | |
"site" | |
"soccer" | |
"social" | |
"software" | |
"solar" | |
"solutions" | |
"soy" | |
"space" | |
"storage" | |
"store" | |
"stream" | |
"studio" | |
"style" | |
"supplies" | |
"supply" | |
"support" | |
"surf" | |
"surgery" | |
"systems" | |
"tax" | |
"taxi" | |
"team" | |
"tech" | |
"technology" | |
"tennis" | |
"theater" | |
"theatre" | |
"tienda" | |
"tips" | |
"tires" | |
"today" | |
"tools" | |
"tours" | |
"town" | |
"toys" | |
"trade" | |
"trading" | |
"training" | |
"tv" | |
"uk" | |
"university" | |
"us" | |
"vacations" | |
"ventures" | |
"vet" | |
"viajes" | |
"video" | |
"villas" | |
"vin" | |
"vip" | |
"vision" | |
"vodka" | |
"voyage" | |
"watch" | |
"webcam" | |
"website" | |
"wedding" | |
"wiki" | |
"win" | |
"wine" | |
"work" | |
"works" | |
"world" | |
"wtf" | |
"xyz" | |
"yoga" | |
"zone" | |
) | |
export registered_strings | |
if [[ "${1}x" == "x" ]]; then | |
echo "Usage: $0 [domain name (no tld)]" | |
exit 1 | |
fi | |
function isavailable() { | |
registered_strings=( | |
"registrant" | |
"not available for registration" | |
"reserved domain name" | |
) | |
whois=$(whois "${1}" 2>/dev/null) | |
if $(echo "$whois" | grep -iq 'queries exceeded'); then | |
echo "-----Rate-limited" | |
return 1 | |
fi | |
for string in "${registered_strings[@]}"; do | |
if $(echo "$whois" | grep -iq "$string"); then | |
return 1 | |
fi | |
done | |
return 0 | |
} | |
export -f isavailable | |
function printifavailable() { | |
isavailable $1 && echo "$1" | |
} | |
export -f printifavailable isavailable | |
declare -a domains_to_check | |
for tld in "${cloudflare_supported_tlds[@]}"; do | |
domains_to_check+=("${1}.${tld}") | |
done | |
parallel printifavailable ::: "${domains_to_check[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment