Skip to content

Check if a domain is registered using Python

Advertisements
import dns.resolver


# Validate a domain has been registered
def is_domain_registered(domain):
    if dns.resolver.resolve(domain):
        return True
    return False


def main():
    # Validate a domain has been registered
    print(is_domain_registered("poopcode.com"))


main()

Source

See also  Python code snippet - How to remove quasi constant column in pandas dataframe?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.