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

Subdomain DNS with A record for subdomain root?

· 52CE 我爱测

I'm spinning off a subdomain from my company's domain. Now, it has been some time since I do DNS/BIND configuration, so I need your help to ensure that my configuration is sane/correct: So, for the parent domain (let's say exampl…

问题原文

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

I'm spinning off a subdomain from my company's domain. Now, it has been some time since I do DNS/BIND configuration, so I need your help to ensure that my configuration is sane/correct:

So, for the parent domain (let's say example.com), I should add the following:

mysub    IN NS 123.231.111.222  ; This is fictitious public IP

And then I set up my own BIND server on 123.231.111.222 with the following contents:

$TTL 600
$ORIGIN mysub.example.com.

@  IN  SOA  ns1 hostmaster (
    2016051201 ; serial
    1h         ; slave refresh
    5m         ; slave retry
    24h        ; slave expiry
    30m        ; nxdomain ttl    
)

@    IN  NS  ns1
@    IN  TXT "v=spf1 ...spf statements follow..."
@    IN  A  123.231.111.222

ns1  IN  A  123.231.111.222

; definition of various hosts in this subdomain follows

So, did I forget/overlook something? Or maybe I have done any mistakes?

已采纳解答

原帖链接 · Andrew B · CC BY-SA 3.0

The basic structure looks fine, but the NS records are bogus. The target must always point at a name, not an IP address. Assuming that you want the name of the target to exist in the newly created zone (based on your example), you will also need glue records.

First zone:

$ORIGIN example.com
; apex records omitted

mysub     IN NS  ns1.mysub
mysub     IN NS  ns2.mysub
ns1.mysub IN A   203.0.113.1
ns2.mysub IN A   198.51.100.1

Second zone:

$ORIGIN mysub.example.com.
; apex SOA omitted

@    IN  NS  ns1
@    IN  NS  ns2
ns1  IN  A   203.0.113.1
ns2  IN  A   198.51.100.1

(Yes, I'm pedantic and put a second nameserver on a different network in there.)

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

资料来源与适用范围

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

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

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