Skip to content

wpalmer/gozone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple DNS ZoneFile parser

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:

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,
	)
}

About

Basic DNS Zone-File parsing (in go)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages