Simple WHOIS PHP Script

WHOIS is a protocol that is widely used for querying databases in order to determine the registrant or assignee of a domain name or IP address (range). In its simplest form, building a small PHP script to query the appropriate WHOIS server and outputting readable information is quite simple, yet complex solutions are usually required to extract full functionality from the WHOIS system.

Below is a very simple script to simply output the registrant of a domain name stored in WHOIS records. There’s minimal security, it doesn’t do much other than check the registrant, it’s poorly coded and it’s not very useful… but it will provide a list of servers and a function or two that may be of use.

Useful Links

>> Delegation details of top-level domains (iana.org)
>> WHOIS on WikiPedia.

First Name:
Your Email Address:
 




Download: Simple WHOIS script
Description: Simple WHOIS script using PHP.
Author:Marty
Category: PHP code
Date: January 12, 2010



If you liked this article, you may also like:

  1. Simple PHP file counter
  2. Force the Download of a File with PHP
  3. Calculate the distance between two geographical points with PHP
  4. Print all files from and below a directory with PHP
  5. Create a Gmail RSS Feed with PHP
About Marty

is a passionate web developer from Sydney, Australia. He owns about 600 websites and makes a healthy living from working the web. As a day job, he works as a pilot for an international airline. Follow Marty on Twitter or Google+.

Comments

  1. MTyler says:

    This code is featured on our University website so it probably explains the spike in visitors.

  2. Terrance says:

    How do I style this and put in Captcha?

  3. ToadFish says:

    Works great & easy to customize into a real working script. You could release this with Captcha and make it a lot easier for those that don’t know how. Good job Marty.

  4. Simon Peter says:

    Simple. Easy. Works. Thank you so, so much.

  5. CT says:

    This script doesn’t work for .co.uk .org.uk .me.uk … any ideas?


    “Please check the following errors:
    Domain extension either invalid or unavailable.”

  6. Mukesh says:

    whois.verisign-grs.com give error when checking domain whois.. :(

  7. 网址导航 says:

    SO GOOD! Thank you very much!!!!!

  8. Thanks,

    It is Working fine on my website, using it on my domain registration website for users to check availability before they can register a domain.

  9. Mukesh says:

    ok at least i have made it..
    Demo= whois.india.dj :p
    Working all fine :)

  10. core says:

    Warning: fsockopen() [function.fsockopen]

  11. Manasi says:

    I’m getting the error:
    Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43
    Plz solve it.

    • Marty says:

      I can ping the address okay. If you haven’t used fsockopen() before, I’d contact your web host and ask them if they had any restrictions on usage.

  12. iLCODE says:

    This script doesn’t work for .ma

  13. Tim says:

    Is there a way to modify the script to give me a list of all new domains registered with whois along with the Administrative Contact info within a certain zip code?

  14. Masetti says:

    I installed the script successfully.

    I notice that for searching whois results for GOOGLE.COM showing some nonsense data.

    Remaining are ok, as far as i tested.

    Any how thanks for the script.

Speak Your Mind

*