Skip to content
forked from wpalmer/gozone

Basic DNS Zone-File parsing (in go)

License

Notifications You must be signed in to change notification settings

bschofield/gozone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 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

  • Go 100.0%