BlueWhois 是一个基于 PHP 的综合网络查询站点,支持 DOMAIN / IPv4 / IPv6 统一输入与查询。
- 综合查询:WHOIS / RDAP / DNS / IP 信息
- 统一 API:
/api/{target}(target支持域名、IPv4、IPv6) - 页面直查:
/{target}(直接打开结果页) - RDAP 优先,失败自动回退 WHOIS 兜底链路
- 统一错误返回与前端状态展示
- API 缓存与手动刷新
- 内页路由:
/about、/contact、/api-docs(由伪静态映射到pages/*.php)
.
├── api/index.php # API 路由入口
├── index.php # 首页 + 直查路由入口
├── whois.php # API/页面查询处理
├── function.php # 核心函数(RDAP/WHOIS/IP/DNS/缓存)
├── config.php # 配置项
├── header.php / footer.php # 公共布局
├── pages/ # 内页(iana / cctlds / about / contact / api-docs)
├── assets/
│ ├── css/
│ ├── js/
│ ├── images/
│ └── fonts/
├── data/iana-tlds.php
├── cache/ # 运行时缓存
└── logs/ # 运行时日志
- PHP 8.1+
mbstring扩展- 建议启用
intl扩展 - Web Server:Nginx / Apache / Caddy
php -S 127.0.0.1:8000访问示例:
http://127.0.0.1:8000/http://127.0.0.1:8000/abouthttp://127.0.0.1:8000/contacthttp://127.0.0.1:8000/api-docshttp://127.0.0.1:8000/index.php?domain=bluewhois.comhttp://127.0.0.1:8000/index.php?domain=1.1.1.1
curl -H "Accept: application/json" \
"http://127.0.0.1:8000/api/bluewhois.com"curl -H "Accept: application/json" \
"http://127.0.0.1:8000/api/1.1.1.1"curl -H "Accept: application/json" \
"http://127.0.0.1:8000/api/2606:4700:4700::1111"IP 地理信息(IPWest 模式):
curl -H "Accept: application/json" \
"http://127.0.0.1:8000/api/ip/1.1.1.1"兼容调用:
curl -H "Accept: application/json" \
"http://127.0.0.1:8000/whois.php?mode=api&domain=bluewhois.com"# 内页路由:/about /contact /api-docs
location = /about { rewrite ^ /pages/about.php last; }
location = /contact { rewrite ^ /pages/contact.php last; }
location = /api-docs { rewrite ^ /pages/api-docs.php last; }
# API:/api/ip/{ip}
location ~ ^/api/ip/(.+)$ {
rewrite ^/api/ip/(.+)$ /api/index.php?mode=ip&target=$1 last;
}
# API:/api/{target}
location ~ ^/api/(.+)$ {
rewrite ^/api/(.+)$ /api/index.php?target=$1 last;
}
# 结果页直查:/{target}
location ~ ^/([^/]+)$ {
if ($1 !~* "^(about|contact|api-docs|api|assets|pages|favicon\\.ico)$") {
rewrite ^/([^/]+)$ /index.php?domain=$1 last;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}- 规范化输入目标(域名 / IPv4 / IPv6)
- 域名优先走 RDAP,再走 WHOIS 兜底
- IP 走 RDAP IP + 地理信息补充
- 统一返回:
success / data / error / api_used / cached
- 新增综合查询能力:支持域名、IPv4、IPv6
- API 文档重构:路径、示例、数据源说明统一
- 新增 API 缓存标识与刷新机制
- 优化内页与卡片结构样式一致性
- 去除根目录重复页面入口,统一由伪静态映射到
pages/ - Footer 字体体系更新:Outfit / Noto Sans SC / Cairo Play
Private/Internal use by repository owner.