mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-08 14:15:30 +08:00
parent
7085096468
commit
e1af3034c7
1 changed files with 10 additions and 7 deletions
|
@ -186,9 +186,17 @@ func rrFormat(zonename string, filename string, recs []dns.RR, defaultTTL uint32
|
||||||
target = strings.Replace(target, " ", "\t", 1)
|
target = strings.Replace(target, " ", "\t", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ttlop string
|
||||||
|
if hdr.Ttl == defaultTTL {
|
||||||
|
ttlop = ""
|
||||||
|
} else {
|
||||||
|
ttlop = fmt.Sprintf(", TTL(%d)", hdr.Ttl)
|
||||||
|
}
|
||||||
|
|
||||||
// NS records at the apex should be NAMESERVER() records.
|
// NS records at the apex should be NAMESERVER() records.
|
||||||
if hdr.Rrtype == dns.TypeNS && name == "@" {
|
if hdr.Rrtype == dns.TypeNS && name == "@" {
|
||||||
typeStr = "NAMESERVER"
|
fmt.Printf(",\n\tNAMESERVER('%s'%s)", target, ttlop)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !dsl { // TSV format:
|
if !dsl { // TSV format:
|
||||||
|
@ -209,12 +217,7 @@ func rrFormat(zonename string, filename string, recs []dns.RR, defaultTTL uint32
|
||||||
default:
|
default:
|
||||||
target = "'" + target + "'"
|
target = "'" + target + "'"
|
||||||
}
|
}
|
||||||
if hdr.Ttl == defaultTTL {
|
fmt.Printf(",\n\t%s('%s', %s%s)", typeStr, name, target, ttlop)
|
||||||
ttl = ""
|
|
||||||
} else {
|
|
||||||
ttl = fmt.Sprintf(", TTL(%d)", hdr.Ttl)
|
|
||||||
}
|
|
||||||
fmt.Printf(",\n\t%s('%s', %s%s)", typeStr, name, target, ttl)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue