r/pythonhelp • • Nov 03 '21

A python script or program to find unregistered domain name

Hi I'm launching a new business & struggling to find a domain. The domains that seem sensible is way beyond the scope of this small business. So, I'm looking for a script or a program that uses every word from the dictionary/ uses 2 words together with a dotcom & searches on the web to see if that name has a website registered. & If it finds that there is no name registered for a perticular domain it will add to a database/ text file. So, we can find a suitable name among those.

4 Upvotes

7 comments sorted by

1

u/carcigenicate Nov 03 '21

For the name lookup, you could just use nslookup using subprocess. Here's a sample example:

from subprocess import run

names_you_generated = ["google", "perpsticklmao", "someothercrap"]

for name in names_you_generated:
    result = run(["nslookup", f"{name}.com"], capture_output=True)

    if b"Non-existent" in result.stderr:
        print("Doesn't Exist:", name)
    else:
        print("Exists:", name)

Exists: google
Doesn't Exist: perpsticklmao
Doesn't Exist: someothercrap

You could also call nslookup to start an interactive session with it, then feed input into the stdin and read from the stdout. This will likely be much more efficient, although harder to implement.

1

u/GameTime_Game0 Nov 03 '21

Thank you this was thank you very much. This was really helpful. I will neednot forget to mention your help on my site

0

u/[deleted] Nov 04 '21

[deleted]

1

u/GameTime_Game0 Nov 04 '21

How to use the who is command?

1

u/Demokadia Nov 03 '21

Try some WD40 and steel wool.

1

u/GameTime_Game0 Nov 03 '21

What are those?

1

u/Caramel-Entire Aug 26 '24

Sarcazm is not your polished side.