PHP Script - Domaincheck

Homer95

New Member
Hi Leute,

hab folgendes Problem:

ich habe ein Domaicheck mit PHP geschrieben. Allerdings kenne ich den .eu Whois Server und auch den response nicht. Wäre nett, wenn mir jemand weiter hilft.

MfG Homer95
 
So, dann schaue ich mal in meine PHP-Whois-Klasse, die folgendes sagt:
PHP:
array('eu', 'whois.eu', 'Status:	AVAILABLE'),
Alles andere ist wie bei allen anderen Whois-Servern :)


MfG Christian
 
PHP:
<?php if(preg_match('/\Ahttps?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?\Z/', 'http://'.$_POST['domain']))
{ 
  $whois=array();
  $whois['.de']['server']='whois.denic.de'; 
  $whois['.de']['string']='Status:      free'; 
  $whois['.com']['server']='whois.crsnic.net'; 
  $whois['.com']['string']='No match for'; 
  $whois['.net']['server']='whois.crsnic.net'; 
  $whois['.net']['string']='No match for'; 
  $whois['.org']['server']='whois.publicinterestregistry.net'; 
  $whois['.org']['string']='NOT FOUND'; 
  $whois['.info']['server']='whois.afilias.net'; 
  $whois['.info']['string']='NOT FOUND'; 
  $whois['.biz']['server']='whois.nic.biz'; 
  $whois['.biz']['string']='Not found'; 
  $whois['.eu']['server']='whois.eu'; 
  $whois['.eu']['string']='Status:    AVAILABLE'; 
  $whois['.ag']['server']='whois.nic.ag'; 
  $whois['.ag']['string']='NOT FOUND'; 
  $whois['.am']['server']='whois.nic.am'; 
  $whois['.am']['string']='No match'; 
  $whois['.as']['server']='whois.nic.as'; 
  $whois['.as']['string']='Domain Not Found'; 
  $whois['.at']['server']='whois.nic.at'; 
  $whois['.at']['string']='nothing found'; 
  $whois['.be']['server']='whois.dns.be'; 
  $whois['.be']['string']='Status:      FREE'; 
  $whois['.cd']['server']='whois.cd'; 
  $whois['.cd']['string']='No match'; 
  $whois['.ch']['server']='whois.nic.ch'; 
  $whois['.ch']['string']='not have an entry'; 
  $whois['.cx']['server']='whois.nic.cx'; 
  $whois['.cx']['string']='Status: Not Registered'; 
  $whois['.dk']['server']='whois.dk-hostmaster.dk'; 
  $whois['.dk']['string']='No entries found'; 
  $whois['.it']['server']='whois.nic.it'; 
  $whois['.it']['string']='Status: AVAILABLE'; 
  $whois['.li']['server']='whois.nic.li'; 
  $whois['.li']['string']='do not have an entry'; 
  $whois['.lu']['server']='whois.dns.lu'; 
  $whois['.lu']['string']='No such domain'; 
  $whois['.nu']['server']='whois.nic.nu'; 
  $whois['.nu']['string']='NO MATCH for'; 
  $whois['.ru']['server']='whois.ripn.net'; 
  $whois['.ru']['string']='No entries found'; 
  $whois['.uk.com']['server']='whois.centralnic.com'; 
  $whois['.uk.com']['string']='No match for'; 
  $whois['.eu.com']['server']='whois.centralnic.com'; 
  $whois['.eu.com']['string']='No match'; 
  $whois['.ws']['server']='whois.nic.ws'; 
  $whois['.ws']['string']='No match for'; 

  $domain=str_replace('www.', '', $_POST['domain']); 

  if(get_magic_quotes_gpc==0) 
  { 
    $domain=addslashes($domain); 
  } 



 $check=fsockopen($whois[$_POST['tld']]['server'], 43); 
  fputs($check, $domain.$_POST['tld']."\r\n"); 
  while(!feof($check))  
  { 
    $report=$report.fgets($check, 128); 
  } 
  fclose($check); 
 
  if(ereg($whois[$_POST['tld']]['string'], $report))
  { 
    echo "<p id=\"dok\"><img src=\"ok.png\" height=\"18\"> Die Domain ".$_POST["domain"].$_POST["tld"]." ist frei !</p>";
	$_SESSION["domain"] = $_POST["domain"].$_POST["tld"];
  } 
  else
  { 
    echo "<p id=\"dno\"><img src=\"no.png\" height=\"18\"> Die Domain ".$_POST["domain"].$_POST["tld"]." ist belegt !</p>";
  } 
} 
?>
 
Hi,

ich habe ein ähnliches Problem. Alle anderen Domains gehen, nur die .eu tut zicken ;)

Das erhalte ich bei jeder .eu Domain:

Code:
% The WHOIS service offered by EURid and the access to the records
% in the EURid WHOIS database are provided for information purposes
% only. It allows persons to check whether a specific domain name
% is still available or not and to obtain information related to
% the registration records of existing domain names.
%
% EURid cannot, under any circumstances, be held liable in case the
% stored information would prove to be wrong, incomplete or not
% accurate in any sense.
%
% By submitting a query you agree not to use the information made
% available to:
%
% - allow, enable or otherwise support the transmission of unsolicited,
%   commercial advertising or other solicitations whether via email or
%   otherwise;
% - target advertising in any possible way;
%
% - to cause nuisance in any possible way to the registrants by sending
%   (whether by automated, electronic processes capable of enabling
%   high volumes or other possible means) messages to them.
%
% Without prejudice to the above, it is explicitly forbidden to extract,
% copy and/or use or re-utilise in any form and by any means
% (electronically or not) the whole or a quantitatively or qualitatively
% substantial part of the contents of the WHOIS database without prior
% and explicit permission by EURid, nor in any attempt hereof, to apply
% automated, electronic processes to EURid (or its systems).
%
% You agree that any reproduction and/or transmission of data for
% commercial purposes will always be considered as the extraction of a
% substantial part of the content of the WHOIS database.
%
% By submitting the query you agree to abide by this policy and accept
% that EURid can take measures to limit the use of its WHOIS services
% in order to protect the privacy of its registrants or the integrity
% of the database.
%
% The EURid WHOIS service on port 43 (textual whois) never
% discloses any information concerning the registrant.
% Registrant information can be obtained through use of the
% webbased whois service available from the EURid website www.eurid.eu
%
% WHOIS whois
Domain:	whois

Registrant:
	NOT DISCLOSED!
	Visit www.eurid.eu for webbased whois.

Registrar Technical Contacts:
	Name:	EURid vzw/asbl Technical staff
	Organisation:	EURid vzw/asbl
	Language:	en
	Phone:	+32.24012750
	Fax:	+32.24012751
	Email:	tech@eurid.eu


Registrar:
	Name:	 EURid vzw/asbl
	Website: www.eurid.eu

Nameservers:
	a.nic.eu
	l.nic.eu
	m.nic.eu

Please visit www.eurid.eu for more info.

Ich nutze
PHP:
fwrite ($handle,'whois '.domain."\r\n");
bei whois.eu auf Port 43.

Danke für eure Hilfe =)
 
Code:
> whois -h whois.eu gibtsnicht.eu
% The WHOIS service offered by EURid and the access to the records
[...]
% WHOIS gibtsnicht
Domain: gibtsnicht
Status: AVAILABLE
 
Steht doch schon deutlich da:



MfG Christian

Nicht aufgedeckt? Das kann ich mir kaum vorstellen, denn das kam auch beim test von sdfsdfasdsdfsdf.eu und die Domain gibt es ganz bestimmt nicht ;)

@Whistler
Vielen dank, werde ich testen.

//Edit
Du meinst aber nicht zufällig den Shell-Befehl whois? Das möchte ich nicht über die Shell realisieren. :/

//Edit 2
Schaut mal bitte hier (ganz unten) http://www.eurid.eu/de/zulassung-als-registrierstelle/suchdienste
Da steht, man muss "whois domainname.eu" verwenden, was aber nicht funktioniert. Mit whois kommt das, was ich oben geschrieben habe, ohne whois, kommt das:

Code:
% The WHOIS service offered by EURid and the access to the records
% in the EURid WHOIS database are provided for information purposes
% only. It allows persons to check whether a specific domain name
% is still available or not and to obtain information related to
% the registration records of existing domain names.
%
% EURid cannot, under any circumstances, be held liable in case the
% stored information would prove to be wrong, incomplete or not
% accurate in any sense.
%
% By submitting a query you agree not to use the information made
% available to:
%
% - allow, enable or otherwise support the transmission of unsolicited,
%   commercial advertising or other solicitations whether via email or
%   otherwise;
% - target advertising in any possible way;
%
% - to cause nuisance in any possible way to the registrants by sending
%   (whether by automated, electronic processes capable of enabling
%   high volumes or other possible means) messages to them.
%
% Without prejudice to the above, it is explicitly forbidden to extract,
% copy and/or use or re-utilise in any form and by any means
% (electronically or not) the whole or a quantitatively or qualitatively
% substantial part of the contents of the WHOIS database without prior
% and explicit permission by EURid, nor in any attempt hereof, to apply
% automated, electronic processes to EURid (or its systems).
%
% You agree that any reproduction and/or transmission of data for
% commercial purposes will always be considered as the extraction of a
% substantial part of the content of the WHOIS database.
%
% By submitting the query you agree to abide by this policy and accept
% that EURid can take measures to limit the use of its WHOIS services
% in order to protect the privacy of its registrants or the integrity
% of the database.
%
% The EURid WHOIS service on port 43 (textual whois) never
% discloses any information concerning the registrant.
% Registrant information can be obtained through use of the
% webbased whois service available from the EURid website www.eurid.eu
%
% WHOIS 
-7: Invalid pattern

//Edit 3
Kann sein dass die ein Problem hatten? Denn jetzt geht es auf einmal :/ Trotzdem danke.
 
Last edited by a moderator:
Moinsen!

Bin gerade durch Zufall auf dieses Forum gestossen. Ich habe das selbe Problem wie Rafioso: Mein Domain-Check funktioniert ganz gut, allerdings klappts mit den *.eu-Domains noch nicht so ganz.

Ich nutze

PHP:
fwrite ($handle,'whois',domain."\r\n");

auf whois.eu (Port 43).

Weiß vielleicht jemand weiter?

PS: Gibt es vielleicht komplett fertige Templates? Sowas sieht doch nicht schlecht aus... http://www.internex.at/de/domain/domain-check.php
 
Wenn du nur ueberpruefen willst ob die Domain verfuegbar ist, ist Whois denkbar schlecht da
a) Ratelimited
b) Viel Datenmuell nur um ein einziges Wort zu lesen

"Sauberere Alternative" (Beispiel der Domain gibtesnicht.eu)

DNS-Root -> query "eu." (NS)
=> Antwort: eu-rootserver.eu IP: 123.123.123.123

eu.-Root -> query "gibtesnicht.eu." (NS)
=> Antwort: NXDOMAIN (Domain existiert nicht) oder NS ns1.provider.tld

Vorteil:
1) nicht rate-limited (zumindest nicht einschraenkend)
2) sehr schnelles Verfahren (DNS Lookup)
3) eine der beiden Queries speicherbar, somit nur 1 UDP-Paket Traffic in/out
3) Gleiche Datenbank wie Whois, somit keine Lookup-Fehler
4) _Alle_ TLD-Zonen ohne Aenderung auslesbar

Realisierungsmoeglichkeiten waeren mit "dig" und shell_exec (poese,poese) oder eine soft-implementierung eines DNS-Clients in PHP ;)
 
Last edited by a moderator:
Back
Top