Documentation
¶
Index ¶
Constants ¶
const (
// Port is the port DNS listens on.
Port = 53
)
Variables ¶
This section is empty.
Functions ¶
func Service ¶
func Service(configurators ...Configurator) host.Configurator
Service returns DNS service.
Types ¶
type AliasConfig ¶
AliasConfig stores configuration of CNAME alias.
type Config ¶
type Config struct {
DNSPort uint16
DKIMPort uint16
Zones map[string]ZoneConfig
ForwardTo []net.IP
ForwardFor []net.IPNet
EnableACME bool
EnableDKIM bool
WaveServers []string
}
Config stores dns configuration.
type Configurator ¶
type Configurator func(c *Config)
Configurator defines function setting the dns configuration.
func ACME ¶
func ACME() Configurator
ACME enables service required to authenticate ACME certificate requests.
func ForwardFor ¶
func ForwardFor(networks ...string) Configurator
ForwardFor sets networks allowed to make forwarded DNS requests.
func ForwardTo ¶
func ForwardTo(servers ...string) Configurator
ForwardTo sets DNS servers for forwarding.
func Waves ¶
func Waves(waves ...string) Configurator
Waves adds wave servers to send challenge requests to.
func Zone ¶
func Zone(domain, nameserver, email string, serialNumber uint32, configurators ...ZoneConfigurator) Configurator
Zone creates new DNS zone.
type ZoneConfig ¶
type ZoneConfig struct {
// Domain is the domain name configured by zone
Domain string
// SerialNumber is incremented whenever zone is changed
SerialNumber uint32
// MainNameserver is the address of the main DNS server
MainNameserver string
// Email is the mailer address of zone manager
Email string
// Nameservers is the list of nameservers for the zone
Nameservers []string
// Domains map domains to IP addresses
Domains map[string][]net.IP
// Aliases map one domain to another
Aliases map[string]AliasConfig
// MailExchanges specifies mail servers.
MailExchanges map[string]uint16
// Texts stores values of TXT records.
Texts map[string][]string
}
ZoneConfig stores dns zone configuration.
type ZoneConfigurator ¶
type ZoneConfigurator func(c *ZoneConfig)
ZoneConfigurator defines function setting the dns zone configuration.
func Domain ¶
func Domain(domain string, ips ...string) ZoneConfigurator
Domain adds A records to the zone.
func MailExchange ¶
func MailExchange(domain string, priority uint16) ZoneConfigurator
MailExchange adds MX record to the zone.
func Nameservers ¶
func Nameservers(nameservers ...string) ZoneConfigurator
Nameservers add nameservers to the zone.
func Text ¶
func Text(domain string, values ...string) ZoneConfigurator
Text adds TXT record to the zone.