How to Code Whois Lookup in Python

With Python you can code a script to conduct a WHOIS lookup on any domain name or IP address. The results will display when you run the program. The WHOIS lookup can tell the owner of the domain that you look up. You can also get other information, including contact details, DNS servers and registrar details.

Instructions

    • 1

      Open your Python script.

    • 2

      Type "import pywhois" and press "Enter."

    • 3

      Type "w = pywhois.whois('example.com')" and press "Enter." Replace "example.com" with the domain or IP address you want to look up.

    • 4

      Type the code for the WHOIS info you want to lookup. For example, to lookup when the domain registration expires, type "w.expiration_date" and press "Enter." For other available options, check your pywhois file.

    • 5

      Type "print w" and press "Enter."

    • 6

      Save your script.

Related Searches:

References

Comments

Related Ads

Featured