domain lookup help please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stylezeca
Forum Newbie
Posts: 13
Joined: Sun Jan 04, 2004 4:27 pm

domain lookup help please

Post 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!
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: domain lookup help please

Post 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
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: domain lookup help please

Post 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!
Post Reply