Agent Skills
返回列表
Chinaz Whois 实时查询

Chinaz Whois 实时查询

开发编程 更新于 2026.08.29

将以下提示词粘贴到你的 AI 对话框中:

请根据 https://skillhub.cn/install/skillhub.md,安装 @org-1qazsc77/chinaz-whois-lookup 技能到我的 AI 助手。

技能介绍

解决的问题

当你需要确认一个域名的注册商、到期时间或隐私保护状态时,逐个访问 whois 查询站点不仅操作重复,还容易遗漏关键字段。本技能直接对接 Chinaz 的「Whois 实时查询」接口,将单域名查询流程脚本化,省去手动复制粘贴的麻烦。

工作流程

  1. 环境准备:提前将 Chinaz 接口的 API Key 写入环境变量(如 CHINAZ_WHOIS_API_KEY),支持 Windows、macOS/Linux 的环境变量配置方式,重启客户端确保生效。
  2. 执行查询:在 Skill 根目录运行 python 脚本(若系统将 Python 3 命名为 python3,则用 python3 替代),脚本会自动从用户输入中提取 domain,去除 URL 的协议、路径、查询参数和片段。
  3. 接口调用与结果解析:脚本读取环境变量中的 Key,向 https://openapi.chinaz.net/v1/1001/whois_whois 发起 GET 请求,返回 JSON 格式结果。code: 1 表示成功,code: 1006 表示未查询到资料,成功结果可能包含域名、Whois 服务器、注册商、注册/更新/到期时间、域名状态、DNS 服务器和隐私保护状态(openProtect: 1 为已开启,0 为未开启)。

适用边界与注意点

  • 隐私保护:对邮箱、电话、联系人等涉及个人或组织隐私的字段,仅在用户明确需要且接口实际返回时最小化展示,不推断、补全或传播相关信息。
  • 结果解读:「是否已注册」仅依据接口返回说明,code: 1006 应表述为「未查询到相关资料」,不等同于「可注册」。
  • 错误处理:missing_api_key 需检查环境变量配置;HTTP 431/432/433/434 提示 Key 缺失或无效;HTTP 436 需检查额度;业务码 1003 表示域名后缀不支持;业务码 1000/1002/1004/10061 需稍后重试,避免高频请求;业务码 1012 需降低频率;network_error 或 timeout 需排查网络、DNS 或代理问题。
  • 使用限制:一次仅查询一个域名,批量任务需逐条执行并遵守频率限制;不用于收集、关联或传播个人信息,不输出或保存 API Key。

How It Works

  1. Core Capability: The skill wraps the Chinaz "Whois Real-time Lookup" API, accepting a single domain input and returning structured Whois data. It requires Python 3 with standard libraries only and supports AI clients that allow local command execution and environment variable access.
  2. Query Process: Extract the domain from user input (strip protocol, path, query parameters, and fragments from URLs), run the Python script in the Skill root directory (use python3 if the system names Python 3 as python3), the script reads the API Key from environment variables, sends a GET request to https://openapi.chinaz.net/v1/1001/whois_whois with domain, ChinazVer=1.0 and APIKey, then parses the JSON response.
  3. Field Interpretation: code: 1 indicates successful query; code: 1006 means no relevant data is found. Successful results may include domain name, Whois server, registrar, update time, registration time, expiration time, domain status, DNS servers and privacy protection status (openProtect: 1 means enabled, 0 means disabled).

Scope & Caveats

  • Privacy Handling: For fields that may involve personal or organizational privacy, such as email, phone, contact person, company, country/province/city, only display them minimally when the user explicitly requests and the API returns them. Do not infer, supplement, associate or spread such information.
  • Result Clarification: The "registered" status is only based on the API response. code: 1006 should be described as "no relevant data found" and not equated to "available for registration".
  • Error Response: missing_api_key requires checking the environment variable configuration; HTTP 431/432/433/434 indicates the Key is missing, malformed or invalid; HTTP 436 requires checking the remaining quota; business code 1003 means the domain suffix is unsupported; business codes 1000/1002/1004/10061 require retrying later without high-frequency requests; business code 1012 requires reducing request frequency; network_error or timeout requires checking network, DNS, proxy or firewall settings.
  • Usage Limits: Query one domain at a time. Batch tasks must be executed one by one and comply with rate limits. Do not use the skill to collect, associate, infer or spread personal information. Do not output, repeat or store the API Key.

使用场景

  • 域名到期排查:运维需确认 example.com 的到期时间,判断是否要在到期前安排续费。
  • 注册商核对:切换服务商时,确认域名的注册商与注册时间是否与合同记录一致。
  • 隐私状态检查:评估某域名是否开启了 Whois 隐私保护,再决定能否对外展示联系方式。
  • 上线前配置验证:核对域名的 DNS 服务器与注册信息是否匹配,避免解析与注册记录冲突。

适合人员

  • 负责域名资产的运维工程师:需要定期核对域名的到期时间与注册商,安排续费或迁移。
  • 管理域名清单的资产管理专员:需要逐条确认各域名的注册状态与关键时间点并留档。
  • 上线前做自检的独立开发者:需要验证目标域名的注册状态与 DNS 配置是否匹配。