Parse a DNS ZoneFile (as specified in https://www.ietf.org/rfc/rfc1035.txt) into a series of more-easily-processed "Record" structures.
The list of RecordTypes, their values, and meanings, was taken from https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml, which in turn references RFCs:
- RFC1035
- RFC1183
- RFC1348
- RFC1637
- RFC1706
- RFC1712
- RFC1876
- RFC1995
- RFC2163
- RFC2168
- RFC2230
- RFC2535
- RFC2536
- RFC2537
- RFC2539
- RFC2782
- RFC2845
- RFC2874
- RFC2915
- RFC2930
- RFC2931
- RFC3008
- RFC3110
- RFC3123
- RFC3225
- RFC3226
- RFC3403
- RFC3596
- RFC3658
- RFC3755
- RFC4025
- RFC4034
- RFC4255
- RFC4398
- RFC4431
- RFC4701
- RFC5155
- RFC5864
- RFC5936
- RFC6563
- RFC6672
- RFC6698
- RFC6742
- RFC6891
- RFC6895
- RFC7043
- RFC7208
- RFC7344
- RFC7477
- RFC7553
- RFC7929
- RFC8005
- RFC8162
- RFC8482
Example:
stream, _ := os.Open(zonefile)
var record gozone.Record
scanner := gozone.NewScanner(h)
for {
err := scanner.Next(&record)
if err != nil {
break
}
fmt.Printf("a '%s' Record for domain/subdomain '%s'",
record.Type,
record.DomainName,
)
}