Find a good available .com domain
If you need a new domain name, and you want a .com, and you don’t want to type random ideas into a registrar search, here’s a way to do it.
Download the list of all registered .com domains
First, apply for access to the zone file, using ICANN’s Centralized Zone Data Service (CZDS) at https://czds.icann.org/. It’s free, but takes a few days to get approved. Read more about it here.
Once approved, they email you a password to log in and download the file called com.txt.gz.
$ du -hs com.txt.gz # 4.6GB compressed
4.6G com.txt.gz
$ gunzip com.txt.gz # uncompress and wait
$ du -hs com.txt
23.0G com.txt # 23 gigs uncompressed
$ wc -l com.txt
404261754 com.txt # 404 million lines
Extract the unique names
com.txt has 404 million lines like this:
zombahomes.com. 172800 in ns ns2.tierra.net.
zombai.com. 172800 in ns ns1.parkingcrew.net.
zombai.com. 172800 in ns ns2.parkingcrew.net.
zombaid.com. 172800 in ns nsg1.namebrightdns.com.
zombaid.com. 172800 in ns nsg2.namebrightdns.com.
zombaimmo.com. 172800 in ns ns10.lwsdns.com.
zombaimmo.com. 172800 in ns ns11.lwsdns.com.
zombaimmo.com. 172800 in ns ns12.lwsdns.com.
zombaimmo.com. 172800 in ns ns17.lwsdns.com.
zombaio.com. 172800 in ns ns-1073.awsdns-06.org.
Domains usually have more than one entry. You need to extract the unique entries. And you only need the part before the “.com”.
Here’s a Ruby script that loops through com.txt, gets the part before .com, skips it if duplicate, and outputs it if unique.
domain = ''
File.open('com.txt', 'r') do |infile|
File.open('domains.txt', 'w') do |outfile|
while line = infile.gets
temp = line[0...(line.index('.com'))]
next if temp == domain
domain = temp
outfile.puts domain
end
end
end
download code
“domains.txt” should now be about 162 million lines - (about 2.2GB) - that look like this:
zombahomes
zombai
zombaid
zombaimmo
zombaio
Load it into SQLite, and index it.
$ sqlite3 domains.db
sqlite> create table domains(domain text);
sqlite> .import "domains.txt" domains
sqlite> create index dd on domains(domain);
Find available dictionary words
If you’re on Mac, Linux, or BSD, you should have a dictionary of words at /usr/share/dict/words. See which of those words are available:
require 'sqlite3'
db = SQLite3::Database.new('domains.db')
query = db.prepare('select domain from domains where domain = ?')
File.readlines('/usr/share/dict/words').each do |word|
rows = query.execute(word.downcase.strip)
puts word unless rows.next
end
download code
Run that, and you’ll have a list of 93,000 dictionary words that are available with the .com extension. Congratulations! Go to porkbun.com (a great little registrar) to register yours.
You’ll find that some are not actually available because that “com.txt” file doesn’t list domains on hold, pending deletion, or without name servers.
Combine short dictionary words
If you are not excited that “electrotelethermometer.com” or “counterexcommunication.com” is available, maybe you would like a combination of two short words? Select only dictionary words up to four letters, then search for the combination.
require 'sqlite3'
words = File.readlines('/usr/share/dict/words').map(&:strip)
words.select! {|w| w.size <= 4}
db = SQLite3::Database.new('domains.db')
query = db.prepare('select domain from domains where domain = ?')
words.each do |word1|
words.each do |word2|
combo = (word1 + word2).downcase
rows = query.execute(combo)
puts combo unless rows.next
end
end
download code
Narrow it down to good words
If you ran that last script, you’ll get tens of millions of available domains like “knabtuik.com” because there are many unknown, ugly, and useless short words.
So make a new file called “goodwords.txt” of only three and four letter words, using grep:
$ grep "^...$" /usr/share/dict/words >> goodwords.txt
$ grep "^....$" /usr/share/dict/words >> goodwords.txt
Edit that file by hand, deleting every word you would never want. (The less you keep, the better.) Then run that Ruby script again, combining just the good words:
require 'sqlite3'
words = File.readlines('goodwords.txt').map(&:strip)
db = SQLite3::Database.new('domains.db')
query = db.prepare('select domain from domains where domain = ?')
words.each do |word1|
words.each do |word2|
combo = (word1 + word2).downcase
rows = query.execute(combo)
puts combo unless rows.next
end
end
download code
Much better, right? A little time consuming, but worth it. This is how I found the name of my new translation service, Inchword.
Need it super-short and nerdy?
One final hack is that there are tons of very-short .com domain names available in the format “letter-number-letter-number”. For example: q7r7.com or e3p3.com.
require 'sqlite3'
db = SQLite3::Database.new('domains.db')
query = db.prepare('select domain from domains where domain = ?')
('a'..'z').each do |a|
('0'..'9').each do |b|
('a'..'z').each do |c|
('0'..'9').each do |d|
combo = a + b + c + d
rows = query.execute(combo)
puts combo unless rows.next
end
end
end
end
download code
Your first ruby script can be also replaced by oneliner:
cat /tmp/com.txt | awk '{ print substr($1, 1, length($1) -5) }' | uniq > domains.txt
Another one liner for the first part:
cut -d "." -f 1 /tmp/com.txt | uniq
cat /tmp/com.txt | awk -F\. '{ print $(NF-1) }' | uniq > domains.txt
I so love reading your elegant ways to solve seemingly difficult problems, Derek. I'm guessing, though, that when people read about 400,000,000, some eyes glazed over.
For the layfolk among us, www.nameboy.com/ isn't as good as it used to be, but it's still really fast and can find decent dot com combos for free in seconds.
I'm not shilling for them, but I've been using it for years. Just saying.
I wrote a similar post but about how to do this for names that are available for sale for a few thousand or less - also without all the programming ;) lauraroeder.com/how-i-nabbed-the-com-for-my-bootstrapped-startup-without-spending-a-million-bucks-6dc35c4606e9
An interesting way to solve the problem, thanks for sharing. My name is too common for a sensible .com so I recently opted for a .uk. It's for personal use so not an issue for me. I assume that's why you're happy with a .rs.
It it against terms to just post it here?
Thanks for the post, this is an awesome project
interesting, fun, educational and useful
This is a hard problem to solve. Unfortunately, your solution is missing probably 10-20% of taken domains. Domains that are premium or have no name servers. I know you said it in your post, but it's a lot when you're talking about ~400M.
We tested all 1-4 letter and character combos as a test and found no completely open .com domains. Even the two you tossed out are not technically open.
We have been trying to write a SAS to help people generate domains domainchipmunk.com and are having a hard time finding a good solution to catch all those premium or no NS domains we generate. We can do it, it just takes a long time. Especially the non .com ones.
Hi Derek
That's good idea. I wish you could turn your method into microSaaS ready to use by those are not that tech savvy or those that want to save time.
I am interested in your last endeavor Inchword because I am translator myself. What is it exactly? is it a some sort of CAT tool? How can I try it? And does it support the rtl language like Arabic and Hebrew?
I created a domain name builder here:
mixmatchdomains.com/
that use similar methods but with some ways to see related words together with fixed sets of words.
I followed the instructions, got the com.txt file but it contains all the registered domains as well as unregistered so every word in my dictionary file matches.
For example, elephant.com is in the com.txt file and is not available.
What did i do wrong?
It's only showing registered domains. That's why elephant.com is in the file. It can't show unregistered since they don't exist yet. That said, maybe since I published this, someone has registered every last dictionary word? But then there are still unregistered unique combinations of dictionary words. — Derek
I found that too and what Derek says make sense but then I don't understand the line in the article "Run that, and you’ll have a list of 93,000 dictionary words that are available with the .com extension. Congratulations! Go to porkbun.com (a great little registrar) to register yours."
Hi Derek,
very nice article and really interesting approach.
I think that the "Find available dictionary words" example is missing .map(&:strip) in order to remove newline characters (as you do in next examples) and that causes to show all words as available.
Wow! You're right. Thank you for the bug fix! Updated that code bit to have word.downcase.strip — Derek
This list of .com domains is all the registered ones. So basically any words from the dictionary that AREN'T in that list should be available.
Huge thanks for the useful article Derek!
Really useful stuff Derek! I made a little companion video to go along with it. :)
youtu.be/qX8K6QqA60g
Is it really necessary to have a dot com now?
With all the options for domain extensions now, plus the upcoming standard of blockchain/web3 domains that I am starting the hear about, it will be very easy to just combine 2 words, like craig.lambie to direct to a IP on the internet.
Thanks Derek!
Late with a comment here, but you can save yourself the extraction step and the temporary domains.txt file (and a ton of time) by using Zlib::GzipReader