mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
convertzone should do a better job with NS records. Fixes https://github.com/StackExchange/dnscontrol/issues/162
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# convertzone -- Converts a standard DNS zonefile into tsv, pretty, or DSL
|
||||
|
||||
This is a crude hack we put together to read a BIND-style zonefile
|
||||
and output a draft DNSControl dnsconfig.js file. It does about 90%
|
||||
of the work, but it isn't complete.
|
||||
|
||||
## Building the software
|
||||
|
||||
Build the software and install in your personal bin:
|
||||
|
@@ -106,6 +106,11 @@ func rrFormat(zonename string, filename string, r io.Reader, defaultTTL uint32,
|
||||
target = strings.Replace(target, " ", "\t", 1)
|
||||
}
|
||||
|
||||
// NS records at the apex should be NAMESERVER() records.
|
||||
if hdr.Rrtype == dns.TypeNS && name == "@" {
|
||||
typeStr = "NAMESERVER"
|
||||
}
|
||||
|
||||
if !dsl { // TSV format:
|
||||
fmt.Printf("%s\t%s\t%s\t%s\t%s\n", name, ttl, classStr, typeStr, target)
|
||||
} else { // DSL format:
|
||||
|
Reference in New Issue
Block a user