Documentation
¶
Overview ¶
Package realm implements a simple non-recursive DNS server.
INSTALLATION ¶
To install realm:
go get -u github.com/brettlangdon/realm/cmd/...
USAGE ¶
Realm will parse your server configuration from a DNS zone file see https://en.wikipedia.org/wiki/Zone_file for more information.
To start a server:
realm ./domain.zone realm --bind "127.0.0.1:1053" ./first.domain.zone ./second.domain.zone
Full command usage:
usage: realm [--bind BIND] [ZONE [ZONE ...]] positional arguments: zone DNS zone files to serve from this server options: --bind BIND [<host>]:<port> to bind too [default: :53] --help, -h display this help and exit
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DomainEntry ¶
type DomainEntry map[uint16]RecordsEntry
DomainEntry is used to hold a mapping of DNS request classes to RecordEntrys
func (DomainEntry) AddEntry ¶
func (entry DomainEntry) AddEntry(record dns.RR)
AddEntry is used to add a new DNS record to this mapping
func (DomainEntry) GetEntries ¶
func (entry DomainEntry) GetEntries(rrClass uint16) []RecordsEntry
GetEntries is used to find the appropriate RecordEntrys for the requested DNS class
type RecordsEntry ¶
RecordsEntry is used to hold a mapping of DNS request types to DNS records
func (RecordsEntry) GetRecords ¶
func (entry RecordsEntry) GetRecords(rrType uint16) []dns.RR
GetRecords will fetch the appropriate DNS records to the requested type
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a container for looking up DNS records for any request
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry will allocate and return a new *Registry
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server listens for DNS requests over UDP and responds with answers from the provided Zone.
func NewServer ¶
NewServer returns a new initialized *Server that will bind to listen and will look up answers from zone.
func (*Server) ListenAndServe ¶
ListenAndServe will start the nameserver on the configured address.
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
A Zone a container for records parsed from a zone file.