RE: [PHP] Don't search for domains on Network Solutions...
| From: | Andrés Robinet | Date: | Wed, 16 Jan 2008 21:27:25 +0000 |
| Subject: | RE: [PHP] Don't search for domains on Network Solutions... | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267438@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Daniel Brown [mailto:parasane@gmail.com]
> Sent: Wednesday, January 16, 2008 5:06 PM
> To: Eric Butera
> Cc: Andrés Robinet; php php
> Subject: Re: [PHP] Don't search for domains on Network Solutions...
>
> On Jan 16, 2008 2:29 PM, Eric Butera <eric.butera@gmail.com> wrote:
> > It obviously isn't related to PHP. I figured that most of us are in
> > the business of making web applications for clients that are accessed
> > through a domain at some point, so I sent it as a general warning to
> > people.
> >
> > My company has recommended people to use it as a simple starting
> point
> > of figuring out what domain name they think they might like. Of
> > course we never use them for anything other than that, but I guess
> the
> > joke is on us in the end, right? :)
>
> Eric,
>
> If you're using a *nix system, try this. I just whipped it up
> now, so it's not going to be perfect, but it will give accurate
> results, without risking any kind of "domain hoarding" (which is
> ridiculous, and companies should be fined for it, in my opinion):
>
> <?
>
> if(!isset($argv[1])) {
> die("Usage: ".$argv[0]." domain.com\n");
> }
>
> $domain = $argv[1];
>
> exec('
which dig '.$domain,$ret,$err);
>
> if($err) {
> die("ERROR: ".$err."\n");
> }
>
> for($i=0;$i<count($ret);$i++) {
> if(preg_match('/status: (.*),/Ui',$ret[$i],$status)) {
> switch($status[1]) {
> case "NXDOMAIN":
> echo "Domain is not registered.\n";
> break;
> case "NOERROR":
> echo "Domain is registered.\n";
> break;
> default:
> echo "Unknown status.\n";
> break;
> }
> }
> }
> ?>
>
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
> Nineteen-Seventy-[mumble].
>
Maybe one of these classes will do the trick if you have exec disabled (like
in most of the shared hosting enviroments), anybody tried them?
http://www.phpclasses.org/searchtag/whois/by/package/tag/whois/
Regards,
Rob