dns_get_record() does not support a request to a specific NS server to determine the NS records of a domain.
还没有人认领这个 Issue。
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
The task is to determine. that my client, which is the owner of the domain, has specified the correct NS records with the registrar, and I can accept it for service on my dns server.
Many people mistakenly think that it is enough to check the NS-record of the domain, but it is not so!
To make things worse, almost all DNS-servers, after accepting a domain for service, create the same NS-records, so that the client could register subdomains (www, mail, etc.). But this NS record only affects subdomains or child domains, not the domain itself.
For example, I will take the domain umi.ru (it is very difficult to find a domain where these records are different).
dig +short NS umi.ru or var_export(dns_get_record('umi.ru', DNS_NS));
ns1.umi.ru.
ns2.umi.ru.
ns3.umi.ru.
ns4.umi.ru.
These NS records are specified by the DNS server, not the domain registrar, and affect subdomains, but not the domain itself.
To get the exact NS records that are specified at the domain registrar. and that respond directly to the domain, that is, to which DNS-server to apply when a request comes to this domain, you need to do the following.
1 Define the parent zone (domain level above) for umi.ru parent zone ru.
2 Get the list of NS-servers of the parent zone.
dig +short NS ru or var_export(dns_get_record('ru', DNS_NS));
a.dns.ripn.net.
b.dns.ripn.net.
d.dns.ripn.net.
e.dns.ripn.net.
f.dns.ripn.net.
3 Get the NS record from exactly one of these servers (authoritative servers).
dig NS @a.dns.ripn.net umi.ru or ... but there is no such function in php and you can't make this request through dns_get_record(). :-(
.......................................................................................
UMI.RU. 345600 IN NS ns1.umi.RU.
UMI.RU. 345600 IN NS ns2.umi.RU.
UMI.RU. 345600 IN NS ns3.umi.RU.
.......................................................................................
Registry and order does not matter, but these 3 NS records prescribed, rather than 4 as above, the registrar of the domain and it is them that I need to get and check to be sure that I can bind this domain to my dns-server.
Most have the same, but it is not always the case and need to get the latter.
I need to be able to get them in php without calling exec('dig NS @a.dns.ripn.net umi.ru', $out, $exit); var_export($out);.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查 PHP 的 dns_get_record() 行为以及 issue 中对应的 dig NS @server domain 查询。确定调用方如何选择特定的权威服务器,并在定义接口之前考虑现有的 DNS 记录 API。完成标准是 PHP 能够从指定服务器直接获取域名的 NS 记录,而无需调用 exec('dig ...')。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- networking
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100