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.
|
|
Download: Simple WHOIS script |
If you liked this article, you may also like:


This code is featured on our University website so it probably explains the spike in visitors.
How do I style this and put in Captcha?
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.
Simple. Easy. Works. Thank you so, so much.
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.”
—
By the way, index.php has:
“co.uk” => “whois.nic.uk”
which should be correct.
whois.verisign-grs.com give error when checking domain whois.. :(
SO GOOD! Thank you very much!!!!!
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.
ok at least i have made it..
Demo= whois.india.dj :p
Working all fine :)
Warning: fsockopen() [function.fsockopen]
I’m getting the error:
Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43
Plz solve it.
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.
This script doesn’t work for .ma
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?
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.