Documentation ¶
Index ¶
- type Server
- func (ds *Server) Close() error
- func (ds *Server) DeleteA(host string) error
- func (ds *Server) DeleteSRV(service, protocol string) error
- func (ds *Server) GetA(name string) []*dns.A
- func (ds *Server) GetSRV(spec string) []*dns.SRV
- func (ds *Server) ListA() (map[string]net.IP, error)
- func (ds *Server) ListSRV() (map[string]*db.SRVRecord, error)
- func (ds *Server) Listen(listenSpec string) error
- func (ds *Server) Listening() (net.IP, uint)
- func (ds *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
- func (ds *Server) SetA(host string, ip net.IP) error
- func (ds *Server) SetSRV(service, protocol string, srv *db.SRVRecord) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶ added in v0.2.0
type Server struct {
// contains filtered or unexported fields
}
Server is the struct which describes the DNS server.
func New ¶ added in v0.2.0
New creates a new DNS server. Domain is an unqualified domain that will be used as the TLD.
func NewWithDB ¶ added in v0.2.0
NewWithDB allows you to provide a custom DB implementation during construction.
func (*Server) Close ¶ added in v0.2.0
Close closes the DNS server. If it is not started, nil is returned.
func (*Server) DeleteA ¶ added in v0.2.0
DeleteA deletes a host. Note that this is not the FQDN, but a hostname.
func (*Server) DeleteSRV ¶ added in v0.2.0
DeleteSRV deletes a SRV record based on the service and protocol.
func (*Server) GetSRV ¶ added in v0.2.0
GetSRV given a service spec, looks up and returns an array of *dns.SRV objects. These must be massaged into the []dns.RR after the fact.
func (*Server) Listen ¶ added in v0.2.0
Listen for DNS requests. listenSpec is a dotted-quad + port, e.g., 127.0.0.1:53. This function blocks and only returns when the DNS service is no longer functioning.
func (*Server) ServeDNS ¶ added in v0.2.0
func (ds *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
ServeDNS is the main callback for miekg/dns. Collects information about the query, constructs a response, and returns it to the connector.