A simple fast Python script to check if domains (based on a base name and multiple TLDs) are already registered. The script uses Python’s whois library under the hood and caches results in JSON format to avoid repeated WHOIS lookups.
This tool lets you quickly check a set of TLDs (Top-Level Domains) for a chosen base name (e.g., mydomain.com, mydomain.org, mydomain.net). By default, it uses a small set of TLDs, but you can also enable an “extensive” mode that attempts a larger list of TLDs.
Whenever you run the script, it caches each WHOIS query result in a JSON file under the results/ folder. This helps avoid unnecessary WHOIS queries for domains you have already checked.
- WHOIS Lookup: Checks if a domain is registered based on
domain_nameandregistrarfields from the WHOIS data. - Threaded Processing: Uses multithreading to speed up lookups.
- Caching: Stores previously fetched WHOIS data to
results/<base_name>.json. - Easy to Extend: You can add more TLDs to the
tlds.txtortlds_extensive.txtfiles.
-
Clone or Download the repository:
git clone https://github.com/raj-71/taken_domain_names_finder.git cd taken_domain_names_finder -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # For Linux/Mac # or venv\Scripts\activate # For Windows
-
Install dependencies:
pip install -r requirements.txt
The key dependency is the python-whois package.
From the project folder, run:
python main.py <base_name> [--extensive] [--print fields]By default, the script uses tlds.txt to look up domains:
python main.py mydomainThis will check each TLD in tlds.txt (like .com, .org, etc.). Any registered domains will be printed in the console.
To use the more comprehensive TLD list in tlds_extensive.txt, add the --extensive flag:
python main.py mydomain --extensiveThis will search against a larger set of TLDs, which could take more time.
You can also ask the script to print certain fields from the WHOIS data for each registered domain. For example, to print the registrar and org fields, run:
python main.py mydomain --print registrar,orgYou can mix and match any fields available in the WHOIS data. Fields are printed in a table-like format.
tlds.txt: Contains a small list of commonly used TLDs.tlds_extensive.txt: Contains an extended list of TLDs.results/: Stores<base_name>.jsonfiles, which cache WHOIS data for each domain checked.
You can customize the TLD list by editing tlds.txt or tlds_extensive.txt directly.
-
Terminal Output:
- When no specific fields are requested (
--printis not used), the script prints the fully qualified domain names (FQDN) of all domains that are registered. - When using
--print fields, it prints a table with the chosen fields for each registered domain.
- When no specific fields are requested (
-
Results Folder:
results/<base_name>.jsonwill store a dictionary of WHOIS data for each<base_name><tld>key.
An example snippet (for mydomain) might look like:
{
"mydomain.com": {
"domain_name": "MYDOMAIN.COM",
"registrar": "Example Registrar, Inc.",
"creation_date": "2021-01-01 00:00:00",
"expiration_date": "2023-01-01 00:00:00",
"name_servers": [
"NS1.EXAMPLE.COM",
"NS2.EXAMPLE.COM"
],
...
},
"mydomain.org": { ... },
...
}