将我域的两个子域定义为另一个域的名称服务器

Defining two sub domains of my domain as nameservers of another domain

假设我拥有由我自己的 DNS 服务器提供服务的 example.com,并且我可以创建我想要的每条记录。

现在假设我的一位朋友获得了一个名为 new-domain.com 的新域,我想帮助他使用自己的 DNS 服务器管理域。

因此在我的 example.com 的 dns 系统中,我创建了两个 A 记录:

my.ns1.example.com -> some.ip.addr

my.ns2.example.com -> some.ip.addr

(some.ip.addr是他的DNS服务器的ip地址)

并要求他将 my.ns1.example.com 和 my.ns2.example.com 设置为其域的名称服务器。

但他无法设置它们,因为它收到无效的名称服务器错误!

据我了解,由于 example.com 在 DNS 系统中正常工作,因此 my.ns1.example.com 和 my.ns2.example.com 已正确解析为 IP 地址,所以没有什么可以阻止它们被用作名称服务器。

我四处搜索,发现有人说应该注册名称服务器。我知道当我们必须要求设置胶水记录时注册,但对于这种情况,我不知道为什么我们需要注册这些名称。

用现实生活中的例子更具体一点,为什么 jobs.ns.cloudflare.com 是一个有效的域名服务器而 www.cloudflare.com 不是?

问题不在于名称:my.ns1.example.commy.ns2.example.com 都可以。

注册管理机构,有时甚至是注册商,通常会在批准名称服务器更改之前执行一些检查。如果您的名称服务器因无效而被拒绝,它们很可能尚未针对您朋友的域正确配置。我的意思是,位于 my.ns1.example.commy.ns2.example.com 的服务器不包含 new-domain.com.

所需的最低记录

也就是说,注册服务商支持团队应该能够提供更多详细信息:如果是他们拒绝更改,他们应该让您知道自动测试的哪一部分失败了,以及甚至提供测试输出,以便您自己查看。另一方面,如果他们只是将更改传递给注册表(您的朋友应该在他的控制面板中看到“操作在注册表级别挂起”通知一段时间),他们可以通过提供基于提示的提示来帮助您做出额外的努力他们使用该特定 TLD 的经验。也就是说,如果您的朋友没有获得该域每年 0.99 美元 -5.99 美元范围内的促销优惠:如果他每年向他们支付 20 美元 -50 美元范围内的东西,那么他应该期望并要求适当的,有帮助的支持。我使用最便宜的注册商之一,如果我的名称服务器更改被拒绝,我仍然会收到完整的报告:

Dear customer,

The registry did not accept the nameservers you tried assigning to new-domain.com because they did not pass the registry tests. Please check the report we got from the registry below, fix the errors and try assigning the nameservers again.

Nameservers Resolvable Test: ERROR
my.ns1.example.com. ERROR Unresolvable host my.ns1.example.com.
my.ns2.example.com. ERROR Unresolvable host my.ns2.example.com.
my.ns3.example.com. OK
my.ns4.example.com. OK

SOAQueryAnswerTest: ERROR
my.ns1.example.com. ERROR java.net.SocketTimeoutException
my.ns2.example.com. ERROR java.net.SocketTimeoutException
my.ns3.example.com. OK
my.ns4.example.com. OK
... ... ...

更新: OP post更新说,一旦名称服务器在注册表中注册,他朋友的控制面板就会接受它们。似乎特定的注册商会检查粘合记录并拒绝名称服务器,如果它们有 none。这是一项不必要的检查,因为只有在名称服务器位于它们所服务的同一域内时才需要粘合记录,如 these questions. Registrars usually explain this very clearly 中所述,或者至少在名称服务器更改表上方提及:

Please note that in most cases the ip address is not required and will actually be ignored. It is only necessary if the nameservers you are entering are sub-domains of the selected domain (also called custom nameservers or vanity nameservers).

我们可以得出结论,朋友的注册商执行了不必要的阻止测试并且在有帮助的情况下没有响应用户查询。由于 OP 有以下需求(引自他在 serverfault 上更新的 post):

I need to be able to create dynamic nameservers programmatically and ask my users to enter their specific nameservers for their domains in their registrars.

我热烈建议他做一些研究,寻找一个体面且价格合理的注册商,他可以将他的 customers/friends 指向以防他们当前的注册商有任何问题。

我在 serverfault.com 和 this link

上问了同样的问题

那里,我在这里引用了答案的重要部分,

From a pure DNS perspective, an authoritative nameserver (such as those for com) should not perform any kind of recursion to learn the IP address of the nameservers that are defined in your example.com zone. Instead, the registry permits registrars to add glue records to the com domain, and those registrars can provide a user interface so that the owners of the domains that these custom nameservers live in can do so. (example: Namecheap - How do I register personal nameservers for my domain?)

(To address the elephant in the room...no, these glue records are not strictly required. But policies are policies, and if the registrar interface requires the registry level glue to be present, you have little choice in the matter.)

虽然答案没有回答我更新的问题部分,但我选择它作为答案并决定再问一个问题。