Foros del Web » Programando para Internet » PHP »

Informacion de DOMINIO

Estas en el tema de Informacion de DOMINIO en el foro de PHP en Foros del Web. Hola estoy haciendo un script que me permite comprobar si un dominio en Internet existe o no. Todo esto ya lo hice(es del tipo whois ...
  #1 (permalink)  
Antiguo 08/09/2004, 07:27
Avatar de JuanKa  
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
De acuerdo Informacion de DOMINIO

Hola estoy haciendo un script que me permite comprobar si un dominio en Internet existe o no. Todo esto ya lo hice(es del tipo whois) y me sale bien, pero ahora quiero que cuando me arrojen como resultado que el dominio ya esta regisrado me salga las caracteristicas del dominio, como por ejemplo :fecha de alta, de caducidad, nombres, dns, etc

Muchas Gracias
  #2 (permalink)  
Antiguo 08/09/2004, 10:49
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
mm Y que rutina usas para hacer el Whois?

Normalmente ese tipo de rutinas acceden al servidor de Whois correspondiente para hacer la consulta y eso arroja cierta cantidad de datos .. otra cosa es que tu rutina filtre/descarte el resto para dar un "libre/ocupado" sólo ... Pon el código que uses.

Un saludo,
  #3 (permalink)  
Antiguo 08/09/2004, 11:37
Avatar de JuanKa  
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Este es el codigo del formulario
<form method="POST" action= "whois_dominio.php">
<table width="299" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th width="299" scope="col"><div align="center">
<INPUT name="dominio" SIZE="30" MAXLENGTH="35">
.
<select name="ext" id="select">
<option value="todos">Todos</option>
<option value="com">com</option>
<option value="net">net</option>
<option value="org">org</option>
<option value="edu">edu</option>
<option value="biz">biz</option>
<option value="info">info</option>
</select>
</div></th>
</tr>
<tr>
<td><div align="center">
<INPUT name="SUBMIT" TYPE="SUBMIT" VALUE="Buscar">
....
<input type="reset" name="Submit" value="Borrar">
</div></td>
</tr>
</table>
</FORM>
********************************************
Bueno este es codigo donde me verifica.... es muy largo... pero... bueno

He copiado cuando selecciono todos en la lista "Todos y .com" el resto todo sale bien

donde iria la parte donde tu me dices....


<?php
function checkDomainReg($domain,$server)
{
if(!$server)
{
$server = 'whois.crsnic.net';
$lineNumber = 8;
$fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
fputs($fp, "$domain\n");
while (!feof($fp))
{
$serverReturn = fgets($fp, 2048);
$x++;
if ($x == $lineNumber)
{ $line = $serverReturn; }
}
fclose($fp);
$token = strtok("$line"," ");

if ($token == 'No')
{ $result = 0; }
else
{$result = 1; }
return $result;
}
else
{
$lineNumber = 8;
$fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
fputs($fp, "$domain\n");
while (!feof($fp))
{ $serverReturn .= fgets($fp, 2048); }

if (substr_count($serverReturn,'NOT FOUND'))
{ $result = 0; }
else
{ $result = 1; }
return $result;
}

}

//********************************************** FIN DE FUNCION ************************************************
$var_dominio=$_POST['dominio'];
$var_extension=$_POST['ext'];

//echo $var_dominio.'<br>';
//echo $var_extension.'<br>';
$punto=".";
$union='www.'.$var_dominio.$punto;
switch($var_extension)
{
case "todos":
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

if(checkDomainReg("$dominio.com",''))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';

echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';
// echo "$dominio.com esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';
// echo "$dominio.com esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.net",''))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'net'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.net esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'net'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.net esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.org",'whois.pir.org'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'org'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.org esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'org'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.org esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.edu",'whois.internic.n et'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'edu'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.edu esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'edu'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.edu esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.biz",'whois.nic.biz'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'biz'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.biz esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'biz'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.biz esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.info",'whois.afilias.n et'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'info'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.info esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'info'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.info esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
echo '</table>';
break;
}

case "com":
{
if(checkDomainReg("$dominio.com",''))
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';
echo '</table>';
// echo "$dominio.com esta registrado<br>";
}

else
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';
echo '</table>';


// echo "$dominio.com esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
break;
}
}

Gracias Amigo de antemano....
Estare muy agradecido....
  #4 (permalink)  
Antiguo 08/09/2004, 12:43
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
Efectivamente conecta a un servidor de whois para ver el registro del dominio y obtener la respuesta ...

En:
$serverReturn tienes el resultado de conectar al servidor Whois que uses .. hazle un echo y observa todo lo que devuelve .. por ahí puedes empezar a filtrar lo que necesites.

O biento toma otro código que ya haga eso .. en sitios como www.phpclasses.org puedes encontrar (buscando por whois)

Un saludo,
  #5 (permalink)  
Antiguo 08/09/2004, 14:14
Avatar de JuanKa  
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Ya lo hice como me dijistes (echo $serverReturn."<br>";) pero me arroja el siguiente resultado:

Whois Server Version 1.3

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

Domain Name: WIFLEY.COM
Registrar: DIRECT INFORMATION PVT. LTD., DBA DIRECTI.COM
Whois Server: whois.directi.com
Referral URL: http://www.directi.com
Name Server: NS1.CDMON.NET
Name Server: NS2.CDMON.NET
Name Server: NS3.CDMON.NET
Status: ACTIVE
Updated Date: 21-jul-2004
Creation Date: 21-jul-2004
Expiration Date: 21-jul-2005


>>> Last update of whois database: Wed, 8 Sep 2004 06:45:48 EDT <<<

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.
************************************************** ****
************************************************** ****

Pero he verificado en otro dopminio y sale lo sieguiente y esto es el que y quiero .... derrepente hay una parametros internos para que me saquen esto:

Whois wifley.com

[ whois.directi.com ]

Registration Service Provided By: CDMON.COM
Contact: [email protected]
Website: http://www.cdmon.com
Abuse Desk Email Address: [email protected]

Domain Name: WIFLEY.COM

Registrant:
Marc Llobet Perez
Marc Llobet Perez ([email protected])
C/ Lloret, 6
PINEDA DE MAR
BARCELONA,08397
ES
Tel. +34.645085766

Creation Date: 21-Jul-2004
Expiration Date: 21-Jul-2005

Domain servers in listed order:
ns1.cdmon.net
ns2.cdmon.net
ns3.cdmon.net


Administrative Contact:
DINFO PINEDA
DAVID PONSDOMENECH FLORES ([email protected])
AV. MEDITERRA, 36
PINEDA DE MAR
BARCELONA,08397
ES
Tel. +34.937660005

Technical Contact:
Marc Llobet Perez
Marc Llobet Perez ([email protected])
C/ Lloret, 6
PINEDA DE MAR
BARCELONA,08397
ES
Tel. +34.645085766

Billing Contact:
DINFO PINEDA
DAVID PONSDOMENECH FLORES ([email protected])
AV. MEDITERRA, 36
PINEDA DE MAR
BARCELONA,08397
ES
Tel. +34.937660005

Status:ACTIVE

The data in this whois database is provided to you for information
purposes only, that is, to assist you in obtaining information about or
related to a domain name registration record. We make this information
available "as is", and do not guarantee its accuracy. By submitting a
whois query, you agree that you will use this data only for lawful
purposes and that, under no circumstances will you use this data to:
(1) enable high volume, automated, electronic processes that stress or
load this whois database system providing you this information; or
(2) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via direct mail,
electronic mail, or by telephone. The compilation, repackaging,
dissemination or other use of this data is expressly prohibited without
prior written consent from us. The registrar of record is
DirectI. We reserve the right to modify
these terms at any time. By submitting this query, you agree to abide
by these terms

LO QUE ESTA DE ROJO ES QUE QUIERO QUE ME SALGA O ACASO SALE DE ACUERDO A COMO SE HAYA REGISTRADO O DEPENDE DEL SERVIDOR

Gracias
  #6 (permalink)  
Antiguo 08/09/2004, 16:38
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
Depende de el servicio de "whois" que uses .. y tal vez si esos datos los dejan como públicos (no sé si al registrar un dominio se podrá indicar eso .. ahora no recuerdo)

Un saludo,
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:38.