Skip to content

Instantly share code, notes, and snippets.

@hnishide
Created July 15, 2021 03:05
Show Gist options
  • Save hnishide/b42fa3fcdb80607df3196c2826f536a3 to your computer and use it in GitHub Desktop.
Save hnishide/b42fa3fcdb80607df3196c2826f536a3 to your computer and use it in GitHub Desktop.
Check availability of domain names at Route 53
sld = "foobar" # Second Level Domain, which is "foobar" in "foobar.com"
tlds = %w[
ac academy accountants adult agency apartments associates auction audio
band bargains bike bingo biz black blue boutique builders business buzz
cab cafe camera camp capital cards care careers cash casino catering cc
center ceo chat cheap church city claims cleaning click clinic clothing
cloud club coach codes coffee college com community company computer
condos construction consulting contractors cool coupons credit creditcard
cruises dance dating deals delivery democrat dental diamonds diet digital
direct directory discount dog domains education email energy engineering
enterprises equipment estate events exchange expert exposed express fail
farm finance financial fish fitness flights florist flowers fm football
forsale foundation fund furniture futbol fyi gallery gift gifts glass
global gold golf graphics gratis green gripe guide guitars guru haus
healthcare help hiv hockey holdings holiday host hosting house im immo
immobilien industries info ink institute insure international investments
io irish jewelry juegos kaufen kim kitchen kiwi land lease legal lgbt life
lighting limited limo link live loan loans lol maison management marketing
mba media memorial mobi moda money mortgage movie name net network news
ninja onl online org partners parts photo photography photos pics pictures
pink pizza place plumbing plus poker porn pro productions properties property
pub qpon recipes red reise reisen rentals repair report republican restaurant
reviews rip rocks run sale sarl school schule services sex sexy shiksha shoes
show singles soccer social solar solutions studio style sucks supplies supply
support surgery systems tattoo tax taxi team technology tennis theater tienda
tips tires today tools tours town toys trade training tv university uno
vacations vegas ventures vg viajes video villas vision voyage watch website
wiki works world wtf xyz zone
]
availables = []
tlds.each do |tld|
domain = "#{sld}.#{tld}"
cmd = "aws route53domains check-domain-availability --region us-east-1 --domain-name #{domain}"
result = `#{cmd}`
if result.include? '"AVAILABLE"'
availables << domain
puts "#{domain} is available"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment