Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Quero Aprender

whois (pesquisa de dominio .br e internacionais)

Recommended Posts

Prezados, Quem puder me ajudar, possa... Preciso deste script, mas francamente não sei por onde começar, ficarei muito grato àqueles que puderem me ajudar, me enviando o código completo.Quero Aprender.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olha tambèm quero esse script...

Estou precisando urgente.

Bom fiz uma pesquisa na web e até o momento não obtive muito sucesso.

Caso encontre alguma coisa antes de todos eu posto.

Peço que se acharem poste aqui...

 

 

http://www.sosdesigners.com/download-file554.html

Ai Galera achei esse script em PHP que faz o que estamos querendo...Bom ainda não o teste mais vou fazer agora...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara vê se é isso que você queria//

 

<?php

/***********************************************************************/

/* PHP .NAME PHP Domain Name Search Whois */

/* =========================== */

/* */

/* Written by Steve Dawson - http://www.stevedawson.com */

/* Freelance Web Developer and PHP, Perl and Javascript programming */

/* */

/* This program is free software. You can redistribute it and/or modify */

/************************************************************************/

 

function perform_whois($domain, $tld)

{

$whois_servers = array(

"name" => "whois.nic.name", );

$whois_avail_strings = array(

"whois.nic.name" => "No match", );

$rawoutput = "";

 

## Oops looks like we gotta error

if(($ns = fsockopen($whois_servers[$tld], 43)) == false) { echo $tld; return 0; }

fputs($ns, $domain.".".$tld."\n");

while(!feof($ns)) { $rawoutput .= fgets($ns, 128); }

fclose($ns);

if(!strlen($rawoutput) || ereg($whois_avail_strings[$whois_servers[$tld]], $rawoutput)) { return 1; }

return 0;

}

function do_namesearch($error = false)

{

## First off, print the search box

?>

<HTML>

<HEAD>

<TITLE>Register a .name Domain Name</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

INPUT.BUTTON{

FONT-WEIGHT: bold;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

background : #EEE8AA;

CURSOR: hand;

}

INPUT{

FONT-WEIGHT: normal;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="400" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER"><P>

<FONT FACE="Arial" SIZE="-1">Use our free service to see if your name is available to register.

<BR>Simply enter your first and last name in to the spaces provided and click on the 'Search' button. </FONT></P>

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="1" ALIGN="CENTER">

<?PHP

## Print this is error in domain name format

if($error == true) { ?>

<TR><TD ALIGN="CENTER"><P><B><FONT FACE="Arial" SIZE="-1" COLOR="#FF0000">

There was an error in the search for your chosen name</FONT></B><BR>

<FONT COLOR="#000000">Your first name and surname must contain only alphanumerical characters<BR> and each must be at least 2 characters in length. </FONT></P>

</TD></TR>

<?PHP } ?>

</TABLE><BR>

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="2">

<TR VALIGN="MIDDLE"><TD VALIGN="MIDDLE" ALIGN="LEFT" HEIGHT="30">

<P ALIGN="CENTER"><B>Search for your name here</B></P><TABLE WIDTH="475" BORDER="0" CELLPADDING="0" CELLSPACING="0">

<TR VALIGN="MIDDLE"> <TD ALIGN="CENTER" HEIGHT="50" VALIGN="MIDDLE">

<FORM METHOD="post"><P>

<INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="30" NAME="forename">

. <INPUT TYPE="text" SIZE="25" MAXLENGTH="30" NAME="surname">

.name<INPUT TYPE="hidden" NAME="step" VALUE="2">

<INPUT TYPE="hidden" NAME="tld" VALUE="name">

<INPUT TYPE="submit" VALUE="Search" CLASS="button"></P></FORM></TD>

</TR> </TABLE></TD></TR></TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD> <TD></TD>

<TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> </TBODY> </TABLE>

</BODY>

</HTML>

<?php

## Now the good part, do the stuff

}

function do_choosename()

{

global $forename;

global $surname;

global $tld;

$surname = str_replace(" ", "", $surname);

$domainname = "";

$emailaddress = "";

 

## check the forename

if((!ereg("^([a-z]|[A-Z]|[0-9]|\-)*$", $forename) || ereg("^\-", $forename) || ereg("\-$", $forename) || strlen($forename) < 2) || (!ereg("^([a-z]|[A-Z]|[0-9]|\-)*$", $surname) || ereg("^\-", $surname) || ereg("\-$", $surname) || strlen($surname) < 2)) {

 

do_namesearch(true);

exit();

}

 

if($tld == "name")

 

{

if (perform_whois($forename.".".$surname, "name")) {

$domainname = $forename.".".$surname.".name";

$emailaddress = $forename."@".$surname.".name";

 

}

 

}

 

## Show this page if Domain is already registered

if($domainname=="") {

?>

<HTML>

<HEAD>

<TITLE>Domain Name Unavailable</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

INPUT.BUTTON{

FONT-WEIGHT: bold;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

background : #EEE8AA;

CURSOR: hand;

}

INPUT{

FONT-WEIGHT: normal;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="475" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER">

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="2">

<TR VALIGN="MIDDLE"><TD VALIGN="MIDDLE" ALIGN="LEFT" HEIGHT="30">

<P ALIGN="CENTER"><FONT FACE="Arial" SIZE="-1" COLOR="#FF0000">

<B>Sorry - Your chosen name has already been registered</b><BR>

<FONT COLOR="#000000">Please use different variations of your name or try using your middle names. </FONT>

</FONT></P><P ALIGN="CENTER">Please enter a different variation of your name below</P>

<TABLE WIDTH="475" BORDER="0" CELLPADDING="0" CELLSPACING="0">

<TR VALIGN="MIDDLE"> <TD ALIGN="CENTER" HEIGHT="50" VALIGN="MIDDLE">

<FORM METHOD="post"><P>

<INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="30" NAME="forename">

. <INPUT TYPE="text" SIZE="25" MAXLENGTH="30" NAME="surname">

.name<INPUT TYPE="hidden" NAME="step" VALUE="2">

<INPUT TYPE="hidden" NAME="tld" VALUE="name">

<INPUT TYPE="submit" VALUE="Search" CLASS="button"></P></FORM></TD>

</TR> </TABLE></TD></TR></TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD> <TD></TD>

<TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> </TBODY> </TABLE>

</BODY>

</HTML>

<?

exit;

}

## Print this page is the domain name is available to register

?>

<HTML>

<HEAD>

<TITLE>Domain Name Available</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="475" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER">

<TABLE WIDTH="98%" CELLPADDING="0" CELLSPACING="4">

<TR><TD ALIGN="CENTER"><?PHP if(strlen($domainname) && strlen($emailaddress)) { ?><P ALIGN="CENTER">

<FONT FACE="Arial" SIZE="-1"><FONT SIZE="+1" COLOR="#FF0000">Congratulations </FONT><BR><BR>Your chosen domain name <B>

<?PHP echo $domainname; ?></B> is available to register.</FONT></P>

<INPUT TYPE="hidden" NAME="domaindata" VALUE="<?php echo urlencode($domainname); ?> <?php echo urlencode($emailaddress); ?>">

<?PHP }?><BR></TD></TR><TR><TD ALIGN="CENTER">

<P><FONT FACE="Arial" SIZE="-1">Your website address and your email addresses will be in the format of :</FONT></P>

<TABLE WIDTH="85%" BORDER="0" CELLPADDING="2" CELLSPACING="1" BGCOLOR="#CCCCCC">

<TR><TD VALIGN="MIDDLE" ALIGN="RIGHT" WIDTH="85" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">Website:</FONT></P></TD>

<TD VALIGN="MIDDLE" ALIGN="RIGHT" BGCOLOR="#f3f3f3">

<P ALIGN="LEFT"><FONT FACE="Arial" SIZE="-1">  <B>www.<?PHP echo $domainname; ?></B></FONT></P></TD>

</TR><TR><TD VALIGN="MIDDLE" ALIGN="RIGHT" WIDTH="85" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">Email:</FONT></P></TD>

<TD ALIGN="LEFT" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">  <B><?PHP echo $forename; ?>@<?PHP echo $surname ; ?>.name</B></FONT></P>

</TD></TR></TABLE><BR></TD> </TR> </TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD>

<TD></TD> <TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD> </TR>

</TBODY> </TABLE>

</BODY>

</HTML>

<?php

}

 

if($submit == "Restart") { unset($step); }

switch($step) {

case 2:

do_choosename();

break;

default:

do_namesearch();

break;

}

?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

interessante cara, vou ver se funciona...se funciona... parabens por que é complicado pacas...rs....

 

 

Cara vê se é isso que você queria//

 

<?php

/***********************************************************************/

/* PHP .NAME PHP Domain Name Search Whois */

/* =========================== */

/* */

/* Written by Steve Dawson - http://www.stevedawson.com */

/* Freelance Web Developer and PHP, Perl and Javascript programming */

/* */

/* This program is free software. You can redistribute it and/or modify */

/************************************************************************/

 

function perform_whois($domain, $tld)

{

$whois_servers = array(

"name" => "whois.nic.name", );

$whois_avail_strings = array(

"whois.nic.name" => "No match", );

$rawoutput = "";

 

## Oops looks like we gotta error

if(($ns = fsockopen($whois_servers[$tld], 43)) == false) { echo $tld; return 0; }

fputs($ns, $domain.".".$tld."\n");

while(!feof($ns)) { $rawoutput .= fgets($ns, 128); }

fclose($ns);

if(!strlen($rawoutput) || ereg($whois_avail_strings[$whois_servers[$tld]], $rawoutput)) { return 1; }

return 0;

}

function do_namesearch($error = false)

{

## First off, print the search box

?>

<HTML>

<HEAD>

<TITLE>Register a .name Domain Name</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

INPUT.BUTTON{

FONT-WEIGHT: bold;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

background : #EEE8AA;

CURSOR: hand;

}

INPUT{

FONT-WEIGHT: normal;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="400" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER"><P>

<FONT FACE="Arial" SIZE="-1">Use our free service to see if your name is available to register.

<BR>Simply enter your first and last name in to the spaces provided and click on the 'Search' button. </FONT></P>

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="1" ALIGN="CENTER">

<?PHP

## Print this is error in domain name format

if($error == true) { ?>

<TR><TD ALIGN="CENTER"><P><B><FONT FACE="Arial" SIZE="-1" COLOR="#FF0000">

There was an error in the search for your chosen name</FONT></B><BR>

<FONT COLOR="#000000">Your first name and surname must contain only alphanumerical characters<BR> and each must be at least 2 characters in length. </FONT></P>

</TD></TR>

<?PHP } ?>

</TABLE><BR>

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="2">

<TR VALIGN="MIDDLE"><TD VALIGN="MIDDLE" ALIGN="LEFT" HEIGHT="30">

<P ALIGN="CENTER"><B>Search for your name here</B></P><TABLE WIDTH="475" BORDER="0" CELLPADDING="0" CELLSPACING="0">

<TR VALIGN="MIDDLE"> <TD ALIGN="CENTER" HEIGHT="50" VALIGN="MIDDLE">

<FORM METHOD="post"><P>

<INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="30" NAME="forename">

. <INPUT TYPE="text" SIZE="25" MAXLENGTH="30" NAME="surname">

.name<INPUT TYPE="hidden" NAME="step" VALUE="2">

<INPUT TYPE="hidden" NAME="tld" VALUE="name">

<INPUT TYPE="submit" VALUE="Search" CLASS="button"></P></FORM></TD>

</TR> </TABLE></TD></TR></TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD> <TD></TD>

<TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> </TBODY> </TABLE>

</BODY>

</HTML>

<?php

## Now the good part, do the stuff

}

function do_choosename()

{

global $forename;

global $surname;

global $tld;

$surname = str_replace(" ", "", $surname);

$domainname = "";

$emailaddress = "";

 

## check the forename

if((!ereg("^([a-z]|[A-Z]|[0-9]|\-)*$", $forename) || ereg("^\-", $forename) || ereg("\-$", $forename) || strlen($forename) < 2) || (!ereg("^([a-z]|[A-Z]|[0-9]|\-)*$", $surname) || ereg("^\-", $surname) || ereg("\-$", $surname) || strlen($surname) < 2)) {

 

do_namesearch(true);

exit();

}

 

if($tld == "name")

 

{

if (perform_whois($forename.".".$surname, "name")) {

$domainname = $forename.".".$surname.".name";

$emailaddress = $forename."@".$surname.".name";

 

}

 

}

 

## Show this page if Domain is already registered

if($domainname=="") {

?>

<HTML>

<HEAD>

<TITLE>Domain Name Unavailable</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

INPUT.BUTTON{

FONT-WEIGHT: bold;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

background : #EEE8AA;

CURSOR: hand;

}

INPUT{

FONT-WEIGHT: normal;

FONT-SIZE: 9pt;

FONT-FAMILY: Arial;

border : hidden;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="475" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER">

<TABLE WIDTH="95%" BORDER="0" CELLPADDING="0" CELLSPACING="2">

<TR VALIGN="MIDDLE"><TD VALIGN="MIDDLE" ALIGN="LEFT" HEIGHT="30">

<P ALIGN="CENTER"><FONT FACE="Arial" SIZE="-1" COLOR="#FF0000">

<B>Sorry - Your chosen name has already been registered</b><BR>

<FONT COLOR="#000000">Please use different variations of your name or try using your middle names. </FONT>

</FONT></P><P ALIGN="CENTER">Please enter a different variation of your name below</P>

<TABLE WIDTH="475" BORDER="0" CELLPADDING="0" CELLSPACING="0">

<TR VALIGN="MIDDLE"> <TD ALIGN="CENTER" HEIGHT="50" VALIGN="MIDDLE">

<FORM METHOD="post"><P>

<INPUT TYPE="TEXT" SIZE="25" MAXLENGTH="30" NAME="forename">

. <INPUT TYPE="text" SIZE="25" MAXLENGTH="30" NAME="surname">

.name<INPUT TYPE="hidden" NAME="step" VALUE="2">

<INPUT TYPE="hidden" NAME="tld" VALUE="name">

<INPUT TYPE="submit" VALUE="Search" CLASS="button"></P></FORM></TD>

</TR> </TABLE></TD></TR></TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD> <TD></TD>

<TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> </TBODY> </TABLE>

</BODY>

</HTML>

<?

exit;

}

## Print this page is the domain name is available to register

?>

<HTML>

<HEAD>

<TITLE>Domain Name Available</TITLE> <STYLE TYPE="text/css">

P {

FONT-SIZE: 10pt;

FONT-FAMILY: Arial;

}

</STYLE>

</HEAD>

<BODY>

<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="475" BGCOLOR="#99B9D0" ALIGN="CENTER">

<TBODY> <TR> <TD><IMG SRC="cp-bcorn.gif" WIDTH="13" HEIGHT="12"></TD>

<TD WIDTH="100%"></TD> <TD ALIGN="right">

<IMG SRC="cp-bcorn2.gif" WIDTH="13" HEIGHT="12"></TD>

</TR> <TR> <TD COLSPAN="3" ALIGN="CENTER">

<TABLE WIDTH="98%" CELLPADDING="0" CELLSPACING="4">

<TR><TD ALIGN="CENTER"><?PHP if(strlen($domainname) && strlen($emailaddress)) { ?><P ALIGN="CENTER">

<FONT FACE="Arial" SIZE="-1"><FONT SIZE="+1" COLOR="#FF0000">Congratulations </FONT><BR><BR>Your chosen domain name <B>

<?PHP echo $domainname; ?></B> is available to register.</FONT></P>

<INPUT TYPE="hidden" NAME="domaindata" VALUE="<?php echo urlencode($domainname); ?> <?php echo urlencode($emailaddress); ?>">

<?PHP }?><BR></TD></TR><TR><TD ALIGN="CENTER">

<P><FONT FACE="Arial" SIZE="-1">Your website address and your email addresses will be in the format of :</FONT></P>

<TABLE WIDTH="85%" BORDER="0" CELLPADDING="2" CELLSPACING="1" BGCOLOR="#CCCCCC">

<TR><TD VALIGN="MIDDLE" ALIGN="RIGHT" WIDTH="85" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">Website:</FONT></P></TD>

<TD VALIGN="MIDDLE" ALIGN="RIGHT" BGCOLOR="#f3f3f3">

<P ALIGN="LEFT"><FONT FACE="Arial" SIZE="-1">  <B>www.<?PHP echo $domainname; ?></B></FONT></P></TD>

</TR><TR><TD VALIGN="MIDDLE" ALIGN="RIGHT" WIDTH="85" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">Email:</FONT></P></TD>

<TD ALIGN="LEFT" BGCOLOR="#f3f3f3">

<P><FONT FACE="Arial" SIZE="-1">  <B><?PHP echo $forename; ?>@<?PHP echo $surname ; ?>.name</B></FONT></P>

</TD></TR></TABLE><BR></TD> </TR> </TABLE></TD> </TR> <TR>

<TD><IMG SRC="cp-bcorn3.gif" WIDTH="13" HEIGHT="12"></TD>

<TD></TD> <TD ALIGN="right"><IMG SRC="cp-bcorn4.gif" WIDTH="13" HEIGHT="12"></TD> </TR>

</TBODY> </TABLE>

</BODY>

</HTML>

<?php

}

 

if($submit == "Restart") { unset($step); }

switch($step) {

case 2:

do_choosename();

break;

default:

do_namesearch();

break;

}

?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu não sei se este código ajuda, mas ele mostra quem é o proprietário do dominio.

 

Devemos cria dois arquivos, sendo um PHP e outro INC, conforme segue abaixo:

 

whois.inc

<?

function get_server($dominio){

$whoisservers = array(

array("ac","whois.nic.ac"),

array("ac.cn","whois.cnnic.net.cn"),

array("ac.jp","whois.nic.ad.jp"),

array("ac.uk","whois.ja.net"),

array("ad.jp","whois.nic.ad.jp"),

array("adm.br","whois.nic.br"),

array("adv.br","whois.nic.br"),

array("aero","whois.information.aero"),

array("ag","whois.nic.ag"),

array("agr.br","whois.nic.br"),

array("ah.cn","whois.cnnic.net.cn"),

array("al","whois.ripe.net"),

array("am.br","whois.nic.br"),

array("arq.br","whois.nic.br"),

array("at","whois.nic.at"),

array("au","whois.aunic.net"),

array("art.br","whois.nic.br"),

array("as","whois.nic.as"),

array("asn.au","whois.aunic.net"),

array("ato.br","whois.nic.br"),

array("be","whois.geektools.com"),

array("bg","whois.digsys.bg"),

array("bio.br","whois.nic.br"),

array("biz","whois.biz"),

array("bj.cn","whois.cnnic.net.cn"),

array("bmd.br","whois.nic.br"),

array("br","whois.registro.br"),

array("ca","whois.cira.ca"),

array("cc","whois.nic.cc"),

array("cd","whois.cd"),

array("ch","whois.nic.ch"),

array("cim.br","whois.nic.br"),

array("ck","whois.ck-nic.org.ck"),

array("cl","whois.nic.cl"),

array("cn","whois.cnnic.net.cn"),

array("cng.br","whois.nic.br"),

array("cnt.br","whois.nic.br"),

array("com","rs.internic.net"),

array("com.au","whois.aunic.net"),

array("com.br","whois.nic.br"),

array("com.cn","whois.cnnic.net.cn"),

array("com.eg","whois.ripe.net"),

array("com.hk","whois.hknic.net.hk"),

array("com.mx","whois.nic.mx"),

array("com.ru","whois.ripn.ru"),

array("com.tw","whois.twnic.net"),

array("conf.au","whois.aunic.net"),

array("co.jp","whois.nic.ad.jp"),

array("co.uk","whois.nic.uk"),

array("cq.cn","whois.cnnic.net.cn"),

array("csiro.au","whois.aunic.net"),

array("cx","whois.nic.cx"),

array("cz","whois.nic.cz"),

array("de","whois.denic.de"),

array("dk","whois.dk-hostmaster.dk"),

array("ecn.br","whois.nic.br"),

array("ee","whois.eenet.ee"),

array("edu","rs.internic.net"),

array("edu.au","whois.aunic.net"),

array("edu.br","whois.nic.br"),

array("eg","whois.ripe.net"),

array("es","whois.ripe.net"),

array("esp.br","whois.nic.br"),

array("etc.br","whois.nic.br"),

array("eti.br","whois.nic.br"),

array("eun.eg","whois.ripe.net"),

array("emu.id.au","whois.aunic.net"),

array("eng.br","whois.nic.br"),

array("far.br","whois.nic.br"),

array("fi","whois.ripe.net"),

array("fj","whois.usp.ac.fj"),

array("fj.cn","whois.cnnic.net.cn"),

array("fm.br","whois.nic.br"),

array("fnd.br","whois.nic.br"),

array("fo","whois.ripe.net"),

array("fot.br","whois.nic.br"),

array("fst.br","whois.nic.br"),

array("fr","whois.nic.fr"),

array("g12.br","whois.nic.br"),

array("gd.cn","whois.cnnic.net.cn"),

array("ge","whois.ripe.net"),

array("ggf.br","whois.nic.br"),

array("gl","whois.ripe.net"),

array("gr","whois.ripe.net"),

array("gr.jp","whois.nic.ad.jp"),

array("gs","whois.adamsnames.tc"),

array("gov","whois.nic.gov"),

array("gs.cn","whois.cnnic.net.cn"),

array("gov.au","whois.aunic.net"),

array("gov.br","whois.nic.br"),

array("gov.cn","whois.cnnic.net.cn"),

array("gov.hk","whois.hknic.net.hk"),

array("gob.mx","whois.nic.mx"),

array("gs","whois.adamsnames.tc"),

array("gz.cn","whois.cnnic.net.cn"),

array("gx.cn","whois.cnnic.net.cn"),

array("he.cn","whois.cnnic.net.cn"),

array("ha.cn","whois.cnnic.net.cn"),

array("hb.cn","whois.cnnic.net.cn"),

array("hi.cn","whois.cnnic.net.cn"),

array("hl.cn","whois.cnnic.net.cn"),

array("hn.cn","whois.cnnic.net.cn"),

array("hm","whois.registry.hm"),

array("hk","whois.hknic.net.hk"),

array("hk.cn","whois.cnnic.net.cn"),

array("hu","whois.ripe.net"),

array("id.au","whois.aunic.net"),

array("ie","whois.domainregistry.ie"),

array("ind.br","whois.nic.br"),

array("imb.br","whois.nic.br"),

array("inf.br","whois.nic.br"),

array("info","whois.afilias.info"),

array("info.au","whois.aunic.net"),

array("it","whois.nic.it"),

array("idv.tw","whois.twnic.net"),

array("int","whois.iana.org"),

array("is","whois.isnic.is"),

array("il","whois.isoc.org.il"),

array("jl.cn","whois.cnnic.net.cn"),

array("jor.br","whois.nic.br"),

array("jp","whois.nic.ad.jp"),

array("js.cn","whois.cnnic.net.cn"),

array("jx.cn","whois.cnnic.net.cn"),

array("kr","whois.krnic.net"),

array("la","whois.nic.la"),

array("lel.br","whois.nic.br"),

array("li","whois.nic.ch"),

array("lk","whois.nic.lk"),

array("ln.cn","whois.cnnic.net.cn"),

array("lt","ns.litnet.lt"),

array("lu","whois.dns.lu"),

array("lv","whois.ripe.net"),

array("ltd.uk","whois.nic.uk"),

array("mat.br","whois.nic.br"),

array("mc","whois.ripe.net"),

array("med.br","whois.nic.br"),

array("mil","whois.nic.mil"),

array("mil.br","whois.nic.br"),

array("mn","whois.nic.mn"),

array("mo.cn","whois.cnnic.net.cn"),

array("ms","whois.adamsnames.tc"),

array("mus.br","whois.nic.br"),

array("mx","whois.nic.mx"),

array("name","whois.nic.name"),

array("ne.jp","whois.nic.ad.jp"),

array("net","rs.internic.net"),

array("net.au","whois.aunic.net"),

array("net.br","whois.nic.br"),

array("net.cn","whois.cnnic.net.cn"),

array("net.eg","whois.ripe.net"),

array("net.hk","whois.hknic.net.hk"),

array("net.lu","whois.dns.lu"),

array("net.mx","whois.nic.mx"),

array("net.uk","whois.nic.uk"),

array("net.ru","whois.ripn.ru"),

array("net.tw","whois.twnic.net"),

array("nl","whois.domain-registry.nl"),

array("nm.cn","whois.cnnic.net.cn"),

array("no","whois.norid.no"),

array("nom.br","whois.nic.br"),

array("not.br","whois.nic.br"),

array("ntr.br","whois.nic.br"),

array("nx.cn","whois.cnnic.net.cn"),

array("nz","whois.domainz.net.nz"),

array("plc.uk","whois.nic.uk"),

array("odo.br","whois.nic.br"),

array("oop.br","whois.nic.br"),

array("or.jp","whois.nic.ad.jp"),

array("org","rs.internic.net"),

array("org.au","whois.aunic.net"),

array("org.br","whois.nic.br"),

array("org.cn","whois.cnnic.net.cn"),

array("org.hk","whois.hknic.net.hk"),

array("org.lu","whois.dns.lu"),

array("org.ru","whois.ripn.ru"),

array("org.tw","whois.twnic.net"),

array("org.uk","whois.nic.uk"),

array("pl","nazgul.nask.waw.pl"),

array("pp.ru","whois.ripn.ru"),

array("ppg.br","whois.nic.br"),

array("pro.br","whois.nic.br"),

array("psi.br","whois.nic.br"),

array("psc.br","whois.nic.br"),

array("pt","whois.ripe.net"),

array("qh.cn","whois.cnnic.net.cn"),

array("qsl.br","whois.nic.br"),

array("rec.br","whois.nic.br"),

array("ro","whois.rotld.ro"),

array("ru","whois.ripn.ru"),

array("sc.cn","whois.cnnic.net.cn"),

array("sd.cn","whois.cnnic.net.cn"),

array("se","whois.nic-se.se"),

array("sg","whois.nic.net.sg"),

array("sh","whois.nic.sh"),

array("sh.cn","whois.cnnic.net.cn"),

array("si","whois.arnes.si"),

array("sk","whois.ripe.net"),

array("slg.br","whois.nic.br"),

array("sm","whois.ripe.net"),

array("sn.cn","whois.cnnic.net.cn"),

array("srv.br","whois.nic.br"),

array("st","whois.nic.st"),

array("sx.cn","whois.cnnic.net.cn"),

array("tc","whois.adamsnames.tc"),

array("th","whois.nic.uk"),

array("tj.cn","whois.cnnic.net.cn"),

array("tmp.br","whois.nic.br"),

array("to","whois.tonic.to"),

array("tr","whois.ripe.net"),

array("trd.br","whois.nic.br"),

array("tur.br","whois.nic.br"),

array("tv","whois.tv"),

array("tv.br","whois.nic.br"),

array("tw","whois.twnic.net"),

array("tw.cn","whois.cnnic.net.cn"),

array("uk","whois.thnic.net"),

array("va","whois.ripe.net"),

array("vet.br","whois.nic.br"),

array("vg","whois.adamsnames.tc"),

array("wattle.id.au","whois.aunic.net"),

array("ws","whois.worldsite.ws"),

array("xj.cn","whois.cnnic.net.cn"),

array("xz.cn","whois.cnnic.net.cn"),

array("yn.cn","whois.cnnic.net.cn"),

array("zlg.br","whois.nic.br"),

array("zj.cn","whois.cnnic.net.cn"),

array("nu","whois.nic.nu"));

 

$whoistotal = count($whoisservers);

for ($x=0;$x<$whoistotal;$x++){

$artld = $whoisservers[$x][0];

$tldlen = intval(0 - strlen($artld));

if (substr($dominio, $tldlen) == $artld) { $whosrv = $whoisservers[$x][1]; }

}

return $whosrv;

}

 

function ver_whois($dom){

$lusrv = get_server($dom);

if (!$lusrv) return "";

 

$fp = fsockopen($lusrv,43);

fputs($fp, "$dom\r\n");

$string="";

while(!feof($fp)){

$string.= fgets($fp,128);

}

fclose($fp);

 

$reg = "/Whois Server: (.*?)\n/i";

preg_match_all($reg, $string, $matches);

$secondtry = $matches[1][0];

 

if ($secondtry){

$fp = fsockopen($secondtry,43);

fputs($fp, "$dom\r\n");

$string="";

while(!feof($fp)){

$string.=fgets($fp,128);

}

fclose($fp);

}

return $string;

}

?>

 

exemplo.php

<?

//Colaboração www.pcdicas.com.br

//Em 05/10/2008, Brasil

?>

<html>

<head>

<title>PHPMAN WHOIS</title>

</head>

 

<body bgcolor="#FFFFFF" text="#000000">

<form name="form1" method="post" action="example.php">

Domínio: <input type="text" name="dom">

<input type="submit" name="Submit">

</form>

<?

if (isset($_POST['dom'])){

$dom = $_POST['dom'];

include "./whois.inc";

$whoisresult = ver_whois($dom);

echo "<pre>".$whoisresult."</pre>";

}

?>

</body>

</html>

 

 

Espero ter ajudado

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.