Page 1 of 1

domain lookup help please

Posted: Tue Mar 16, 2004 3:59 am
by stylezeca
how would i make it to lookup if a domain is taken or not for my hosting site im working on... if anyone could help, thanks!

Re: domain lookup help please

Posted: Tue Mar 16, 2004 9:23 am
by TheBentinel.com
stylezeca wrote:how would i make it to lookup if a domain is taken or not for my hosting site im working on... if anyone could help, thanks!
You could do a "host" on it and see if anything comes back. (Assuming you're on a unix-ish system, not Windows)

Code: Select all

$output = pass_thru ("host thebentinel.com");
print ($output);
Note warnings on doc page for pass_thru: http://us4.php.net/pass_thru

That's not 100%, just because no information comes back from host doesn't mean it's available. But if something DOES come back, that means it's not available. (Unless Verisign pulls that stunt with Sitefinder again. Evil empire, they.)

My hosting provider, lomag.net, does it when I try to register a domain. You could contact them and ask them how they do it. support@lomag.net

Re: domain lookup help please

Posted: Tue Mar 16, 2004 9:31 am
by TheBentinel.com
TheBentinel.com wrote:You could do a "host" on it and see if anything comes back.
No, wait. There's apparently some builtin functions in PHP that do this and do it right. (Or so the docs claim)

Check out http://us4.php.net/checkdnsrr

Hope it helps!