Development PHP

Authored by Corey Ballou

Finding Available Domains By Keyword Combination In PHP

There are numerous sites for finding available .COM domain names. Generally, these sites will not turn up the kind of results you are actually looking for when trying to find the perfect domain for your startup, personal site, or business. With the following simple snippet of code you will be able to generate a list of all available two word combinations for a supplied list of keywords. It can be ran from the command line and can output a txt file of all matching domains.

It’s very easy to tweak and add in more advanced functionality such as:

  • Search for domain names with a prefix or suffix.
  • Search for domain names of a specific TLD by adding additional WHOIS hosts mapped to TLDs.
  • Search for available domain names that contain hyphens between keywords.
  • Search for short domain names by checking random characters for availability (i.e. 5 digit domains).

The possibilities really are endless. I personally tend to use this script in combination with Bust A Name because of it’s great thesaurus feature. This script gives you your own personal flexibility in domain name finding:

Simply modify the $words array, save the code as domain-name-finder.php, and run the following command in your console to execute:

It’s worth noting that you should keep the keyword list fairly short as to not DoS the whois servers. This is mainly due to the fact the basic implementation has no timeout/sleep between calls. It is also recommended that you search for a greater number of public whois servers as to alleviate the number of requests per server when iterating over a large list of combinations.

Happy hunting and please let me know how things turn out!

Author: Corey Ballou

Corey Ballou is the CEO of Whether you're a student, young professional, entrepreneur, startup, or small business, you can be up and online fast with your own custom domain, email, and webpage on POP. Corey is a professional PHP developer by trade, specializing in custom web applications development for startups, small businesses, and agencies. Follow Corey on Twitter @cballou.