Skip to content

Instantly share code, notes, and snippets.

@wwek
Created February 5, 2015 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwek/f032b084471d7e8e8858 to your computer and use it in GitHub Desktop.
Save wwek/f032b084471d7e8e8858 to your computer and use it in GitHub Desktop.
通过whois标准接口查询域名的注册情况
<?php
/**
* [$conn 通过whois标准接口查询域名的注册情况]
* 来源网址:http://v2ex.com/t/168346
* 统一的whois标准协议,43端口。扫注册商是把简单的事情高复杂了。
* 每一种后缀的管理机构不一样,官方whois源也不一样。icann的whois.internic.net只负责.com和.net
* 其他常见的:
* .cn : whois.cnnic.net.cn
* .biz : whois.neulevel.biz
* .us : whois.nic.us
* .info : whois.nic.info
* .name : whois.nic.name
* .gov : whois.nic.gov
* .edu : whois.internic.net
* .cc : whois.nic.cc
* whois.internic.net 允许批量扫描。其他后缀有的限制频率,有的不限
*/
$conn = fsockopen ("whois.internic.net", 43);
fputs($conn, "v2ex.com"."\r\n");
while(!feof($conn)){ $output .= fgets($conn,1024); }
echo $output;
?>
@wwek
Copy link
Author

wwek commented Feb 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment