Commit 97530573 authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

backend: fix root zone usage (#4039)

properly concatenate labels by using dnsutil.Join instead of '+'

Fixes: #3316
Signed-off-by: default avatarMiek Gieben <miek@miek.nl>
parent f23171af
...@@ -422,7 +422,7 @@ func NS(ctx context.Context, b ServiceBackend, zone string, state request.Reques ...@@ -422,7 +422,7 @@ func NS(ctx context.Context, b ServiceBackend, zone string, state request.Reques
old := state.QName() old := state.QName()
state.Clear() state.Clear()
state.Req.Question[0].Name = "ns.dns." + zone state.Req.Question[0].Name = dnsutil.Join("ns.dns.", zone)
services, err := b.Services(ctx, state, false, opt) services, err := b.Services(ctx, state, false, opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
...@@ -462,12 +462,8 @@ func SOA(ctx context.Context, b ServiceBackend, zone string, state request.Reque ...@@ -462,12 +462,8 @@ func SOA(ctx context.Context, b ServiceBackend, zone string, state request.Reque
header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: ttl, Class: dns.ClassINET} header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: ttl, Class: dns.ClassINET}
Mbox := hostmaster + "." Mbox := dnsutil.Join(hostmaster, zone)
Ns := "ns.dns." Ns := dnsutil.Join("ns.dns", zone)
if zone[0] != '.' {
Mbox += zone
Ns += zone
}
soa := &dns.SOA{Hdr: header, soa := &dns.SOA{Hdr: header,
Mbox: Mbox, Mbox: Mbox,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment