zone

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootServers

func GetRootServers(nameserver string) ([]string, error)

GetRootServers returns the DNS root servers

Types

type Zone

type Zone struct {
	// map of names to nameservers
	NS map[string][]string
	// map of nameservers to ipv4 and ipv6
	IP map[string][]net.IP
	// number of records added to the zone
	Records int64
}

Zone contains the nameservers and nameserver IPs in a zone

func ParseZoneFile

func ParseZoneFile(filename string) (Zone, error)

ParseZoneFile parses the provided zonefile into a Zone

func RootAXFR

func RootAXFR(ns string) (Zone, error)

RootAXFR returns a Zone containing the ROOT zone

func (*Zone) AddIP

func (z *Zone) AddIP(nameserver string, ip net.IP)

AddIP adds a nameserver IP pair to the zone

func (*Zone) AddNS

func (z *Zone) AddNS(domain, nameserver string)

AddNS adds a domain nameserver pair to the zone

func (*Zone) AddRecord

func (z *Zone) AddRecord(r dns.RR)

AddRecord adds NS, A, AAAA records to the zone

func (*Zone) CountNS

func (z *Zone) CountNS() int

CountNS returns the number of nameservers in the zone

func (*Zone) GetNameChan

func (z *Zone) GetNameChan() chan string

GetNameChan returns a channel of domains in the zone

func (*Zone) Print

func (z *Zone) Print()

Print prints the zone to stdout

func (*Zone) PrintTree

func (z *Zone) PrintTree()

PrintTree prints the zone in tree format to stdout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL