Skip to content

Commit

Permalink
Simplify handling NS confg
Browse files Browse the repository at this point in the history
  • Loading branch information
abh committed Sep 1, 2012
1 parent 7ef56d9 commit 502d71a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,18 @@ func setupZoneData(data map[string]interface{}, Zone *Zone) {

case dns.TypeNS:
rec := records[rType][i]
h.Ttl = 86400
rr := &dns.RR_NS{Hdr: h}
if h.Ttl < 86400 {
h.Ttl = 86400
}

var ns string

switch rec.(type) {
case string:
rr.Ns = rec.(string)
ns = rec.(string)
case []string:
recl := rec.([]string)
rr.Ns = recl[0]
ns = recl[0]
if len(recl[1]) > 0 {
log.Println("NS records with names syntax not supported")
}
Expand All @@ -272,11 +275,8 @@ func setupZoneData(data map[string]interface{}, Zone *Zone) {
panic("Unrecognized NS format/syntax")
}

rr.Ns = dns.Fqdn(rr.Ns)
rr := &dns.RR_NS{Hdr: h, Ns: dns.Fqdn(ns)}

if h.Ttl < 43000 {
h.Ttl = 43200
}
record.RR = rr

default:
Expand Down

0 comments on commit 502d71a

Please sign in to comment.