Bonjour, j'ai codé en PHP un whois personnel à titre expérimental, en utilisant PEAR, Net/Whois. Cela fonctionne mais quand j'ai testé la chose sur des sites comme google.com ou yahoo.com j'ai eu le droit à une grosse surprise :
suivi d'une liste de domaines, certains réels, certains fantaisistes.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 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. YAHOO.COM.ZZZZZZ.MORE.INFO.AT.WWW.BEYONDWHOIS.COM YAHOO.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
Puis:
Au départ j'ai cru à un hack, mais les sites whois me renvoient l'information correcte pour yahoo. J'ai donc lu le texte, et il semblerait qu'il y ait un moyen de récupérer l'information en utilisant le signe "=". Sauf que je n'ai pas trouvé exactement comment...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 YAHOO.COM.BGPETERSON.COM YAHOO.COM.AU YAHOO.COM To single out one record, look it up with "xxx", where xxx is one of the of the records displayed above. If the records are the same, look them up with "=xxx" to receive a full display for each record.
Quelqu'un pourrait-il éclaircir ma lanterne à ce sujet ? Peut-être la fonctionnalité whois de PEAR n'appelle pas le bon serveur en premier ?
Le code php :
avec $serveur = null;
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 $whois = new Net_Whois; $tampon = $whois->query($query, $serveur); return $tampon ;
Partager