|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
check domain name availability
Hi guys,
is there anyone can give me an idea how to write a simple code to check the availability of a domain name... last time one of my friend told me that i can use socket function to check and he did give me the sample code.. unfortunately, i lost the code.. can u guys assist me on this ? please advise. thanks |
|
#2
|
|||
|
|||
|
DNS query using Sockets
Hi
You need a function to query a DNS Server using sockets. Try something like this <? function whois($name) { $soc = fsockopen('whois.geektools.com', 43); if($soc) { fputs($soc, $name.'\r\n'); while(!feof($soc)) { $info .= fread($soc, 1024); } fclose($soc); } return $info; } echo whois($_POST['search']); ?> |
|
#3
|
|||
|
|||
|
Quote:
It would make life simpler to use create an instance of this domain class: http://aspn.activestate.com/ASPN/Co...P/Recipe/266624
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > check domain name availability |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|