dns: drop CNAME for primary name server
This commit is contained in:
parent
393a0eae93
commit
e1bcbc6832
17
agent/dns.go
17
agent/dns.go
|
@ -216,23 +216,6 @@ func (d *DNSServer) handleQuery(resp dns.ResponseWriter, req *dns.Msg) {
|
|||
m.Answer = append(m.Answer, d.soa())
|
||||
m.Ns = append(m.Ns, ns...)
|
||||
m.Extra = append(m.Extra, glue...)
|
||||
|
||||
// add CNAMEs for "ns.<domain>" to the Extra
|
||||
// section to make the MNAME entry in the SOA
|
||||
// record resolvable
|
||||
for _, rr := range ns {
|
||||
cname := &dns.CNAME{
|
||||
Hdr: dns.RR_Header{
|
||||
Name: "ns." + d.domain,
|
||||
Rrtype: dns.TypeCNAME,
|
||||
Class: dns.ClassINET,
|
||||
Ttl: uint32(d.config.NodeTTL / time.Second),
|
||||
},
|
||||
Target: rr.(*dns.NS).Ns,
|
||||
}
|
||||
m.Extra = append(m.Extra, cname)
|
||||
}
|
||||
|
||||
m.SetRcode(req, dns.RcodeSuccess)
|
||||
|
||||
case dns.TypeNS:
|
||||
|
|
Loading…
Reference in New Issue