大网数据广告活动
服务器运维问答

Creating NS records pointing to NS records

· 52CE 我爱测

We have a situation where sometimes we need to get our clients to set up the NS records to point to our service. I'd like to make this as easy as possible and was wondering if I can create NS records that resolve to the real NS r…

问题原文

原帖链接 · DomE · CC BY-SA 3.0

We have a situation where sometimes we need to get our clients to set up the NS records to point to our service.

I'd like to make this as easy as possible and was wondering if I can create NS records that resolve to the real NS records.

For example the client adds:

joebloggs.com NS joebloggs.com.ns1.mydomain.com
joebloggs.com NS joebloggs.com.ns2.mydomain.com

And I add to mydomain.com:

joebloggs.com.ns1.mydomain.com NS the.real.ns1.server.com
joebloggs.com.ns2.mydomain.com NS the.real.ns2.server.com

Would this work? Is it good practice? Should I make each of the fake NS records point to both real NS records? (like this)

joebloggs.com.ns1.mydomain.com NS the.real.ns1.server.com
joebloggs.com.ns1.mydomain.com NS the.real.ns2.server.com

joebloggs.com.ns2.mydomain.com NS the.real.ns1.server.com
joebloggs.com.ns2.mydomain.com NS the.real.ns2.server.com

It looks like using CNAME is not appropriate. In DNS can an IN NS point to a CNAME?

Would the above be ok? Is there a better solution?

已采纳解答

原帖链接 · Patrick Mevzek · CC BY-SA 3.0

This will not work like that.

You would need to publish A/AAAA records for joebloggs.com.ns1.mydomain.com and joebloggs.com.ns2.mydomain.com since RDATA part of a NS record is an hostname that needs to be contacted and hence it must have A/AAAA records. The second set of NS records would never be queried as the labels are not zones with a SOA.

The NS RDATA could be a CNAME but this is not recommended.

I do not see exactly what you try to do/hide by doing things like that. You can instead do one of the following:

  1. give your clients the true NS records; this is the recommended solution, far above all the others
  2. give them any other kind of NS records while making sure they resolve to the same A/AAAA records as the true nameservers (this will make changing their IP addresses very complicated); as long as you provision them with their A/AAAA records, it can be joebloggs.com.ns1.mydomain.com etc. or even ns1.joebloggs.com etc. also called vanity nameservers; this last case involves however creating glue records at the registry through the sponsoring registrar which would create you far more work than desired for almost no benefit.

In short, why do you want to (try to) hide the real nameservers from your clients anyway?

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。