Categorygithub.com/coderobe/godns/v2
modulepackage
2.0.0
Repository: https://github.com/coderobe/godns.git
Documentation: pkg.go.dev

# README

Fork of miekg/dns

Do not use this. Its only use is in coderobe/dnsrewrite

# Packages

Package dnsutil contains higher-level methods useful with the dns package.

# Functions

ActivateAndServe activates a server with a listener from systemd, l and p should not both be non-nil.
CanonicalName returns the domain name in canonical form.
CertificateToDANE converts a certificate to a hex string as used in the TLSA or SMIMEA records.
ClientConfigFromFile parses a resolv.conf(5) like file and returns a *ClientConfig.
ClientConfigFromReader works like ClientConfigFromFile but takes an io.Reader as argument.
CompareDomainName compares the names s1 and s2 and returns how many labels they have in common starting from the *right*.
Copy returns a new RR which is a deep-copy of r.
CountLabel counts the number of labels in the string s.
Dedup removes identical RRs from rrs.
Dial connects to the address on the named network.
DialTimeout acts like Dial but takes a timeout.
DialTimeoutWithTLS acts like DialWithTLS but takes a timeout.
DialWithTLS connects to the address on the named network with TLS.
Exchange performs a synchronous UDP query.
ExchangeConn performs a synchronous query.
ExchangeContext performs a synchronous UDP query, like Exchange.
Field returns the rdata field i as a string.
Fqdn return the fully qualified domain name from s.
Handle registers the handler with the given pattern in the DefaultServeMux.
HandleFailed returns a HandlerFunc that returns SERVFAIL for every request it gets.
HandleFunc registers the handler function with the given pattern in the DefaultServeMux.
HandleRemove deregisters the handle with the given pattern in the DefaultServeMux.
HashName hashes a string (label) according to RFC 5155.
IsDomainName checks if s is a valid domain name, it returns the number of labels and true, when a domain name is valid.
IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL.
IsFqdn checks if a domain name is fully qualified.
IsMsg sanity checks buf and returns an error if it isn't a valid DNS packet.
IsRRset checks if a set of RRs is a valid RRset as defined by RFC 2181.
IsSubDomain checks if child is indeed a child of the parent.
Len returns the length (in octets) of the uncompressed RR in wire format.
ListenAndServe Starts a server on address and network specified Invoke handler for incoming queries.
ListenAndServeTLS acts like http.ListenAndServeTLS, more information in http://golang.org/pkg/net/http/#ListenAndServeTLS.
NewRR reads the RR contained in the string s.
NewServeMux allocates and returns a new ServeMux.
NewZoneParser returns an RFC 1035 style zonefile parser that reads from r.
NextLabel returns the index of the start of the next label in the string s starting at offset.
NumField returns the number of rdata fields r has.
PackDomainName packs a domain name s into msg[off:].
PackRR packs a resource record rr into msg[off:].
ParseZone reads a RFC 1035 style zonefile from r.
PrevLabel returns the index of the label when starting from the right and jumping n labels to the left.
PrivateHandle registers a private resource record type.
PrivateHandleRemove removes definitions required to support private RR type.
ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a net.UDPAddr.
ReadRR reads the RR contained in r.
ReverseAddr returns the in-addr.arpa.
SMIMEAName returns the ownername of a SMIMEA resource record as per the format specified in RFC 'draft-ietf-dane-smime-12' Section 2 and 3.
Split splits a name s into its label indexes.
SplitDomainName splits a name string into it's labels.
StringToTime translates the RRSIG's incep.
TimeToString translates the RRSIG's incep.
TLSAName returns the ownername of a TLSA resource record as per the rules specified in RFC 6698, Section 3.
TsigGenerate fills out the TSIG record attached to the message.
TsigVerify verifies the TSIG on a message.
UnpackDomainName unpacks a domain name into a string.
UnpackRR unpacks msg[off:] into an RR.
UnpackRRWithHeader unpacks the record type specific payload given an existing RR_Header.
WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr.

# Constants

Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Different Certificate Types, see RFC 4398, Section 2.1.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
valid Question.Qclass.
Wire constants and supported types.
DefaultMsgSize is the standard default for messages larger than 512 bytes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
EDNS0 Cookie.
DNSSEC Algorithm Understood.
DS Hash Understood.
EDNS0 expire.
long lived queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01.
End of range reserved for local/experimental use (See RFC 6891).
Beginning of range reserved for local/experimental use (See RFC 6891).
NSEC3 Hash Understood.
nsid (See RFC 5001).
EDNS0 padding (See RFC 7830).
client-subnet (See RFC 7871).
EDNS0 tcp keep alive (See RFC 7828).
update lease draft: http://files.dns-sd.org/draft-sekar-dns-ul.txt.
RFC 5933.
HMAC hashing codes.
HMAC hashing codes.
HMAC hashing codes.
HMAC hashing codes.
DNSSEC encryption algorithm codes.
Various constants used in the LOC RR.
Various constants used in the LOC RR.
RFC 1876, Section 2.
Various constants used in the LOC RR.
RFC 1876, Section 2.
MaxMsgSize is the largest possible DNS packet.
MinMsgSize is the minimal size of a DNS packet.
Accept the message.
Ignore the error and send nothing back.
Reject the message with a RcodeFormatError.
Reject the message with a RcodeNotImplemented.
Wire constants and supported types.
Wire constants and supported types.
Message Opcodes.
Wire constants and supported types.
Wire constants and supported types.
Private (experimental keys).
DNSSEC encryption algorithm codes.
BADALG - Algorithm not supported [TKEY].
BADCOOKIE - Bad/missing Server Cookie [DNS Cookies].
BADKEY - Key not recognized [TSIG].
BADMODE - Bad TKEY Mode [TKEY].
BADNAME - Duplicate key name [TKEY].
BADSIG - TSIG Signature Failure [TSIG].
BADTIME - Signature out of time window [TSIG].
BADTRUNC - Bad Truncation [TSIG].
BADVERS - Bad OPT Version [EDNS0].
FormErr - Format Error [DNS].
NXDomain - Non-Existent Domain [DNS].
NotAuth - Server Not Authoritative for zone [DNS Update].
NotImp - Not Implemented [DNS].
NotZone - Name not contained in zone [DNS Update/TSIG].
NXRRSet - RR Set that should exist does not [DNS Update].
Refused - Query Refused [DNS].
ServFail - Server Failure [DNS].
NoError - No Error [DNS].
YXDomain - Name Exists when it should not [DNS Update].
YXRRSet - RR Set Exists when it should not [DNS Update].
DNSKEY flag values.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSSEC encryption algorithm codes.
DNSKEY flag values.
RFC 4034.
RFC 4509.
Experimental.
Experimental.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
valid Question.Qtype only.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
EDNS.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
Wire constants and supported types.
DNSKEY flag values.

# Variables

AlgorithmToHash is a map of algorithm crypto hash IDs to crypto.Hash's.
AlgorithmToString is a map of algorithm IDs to algorithm names.
CertTypeToString converts the Cert Type to its string representation.
ClassToString is a maps Classes to strings for each CLASS wire type.
DefaultMsgAcceptFunc checks the request and will reject if: * isn't a request (don't respond in that case) * opcode isn't OpcodeQuery or OpcodeNotify * Zero bit isn't zero * has more than 1 question in the question section * has more than 1 RR in the Answer section * has more than 0 RRs in the Authority section * has more than 2 RRs in the Additional section .
DefaultServeMux is the default ServeMux used by Serve.
ErrAlg indicates an error with the (DNSSEC) algorithm.
ErrAuth indicates an error in the TSIG authentication.
ErrBuf indicates that the buffer used is too small for the message.
ErrConnEmpty indicates a connection is being used before it is initialized.
ErrExtendedRcode ...
ErrFqdn indicates that a domain name does not have a closing dot.
ErrId indicates there is a mismatch with the message's ID.
Errors defined in this package.
ErrKeyAlg indicates that the algorithm in the key is not valid.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
Errors defined in this package.
ErrSig indicates that a signature can not be cryptographically validated.
ErrSOA indicates that no SOA RR was seen when doing zone transfers.
ErrTime indicates a timing error in TSIG authentication.
HashToString is a map of hash IDs to names.
Id by default returns a 16-bit random number to be used as a message id.
OpcodeToString maps Opcodes to strings.
RcodeToString maps Rcodes to strings.
StringToAlgorithm is the reverse of AlgorithmToString.
StringToCertType is the reverseof CertTypeToString.
StringToClass is the reverse of ClassToString, needed for string parsing.
StringToHash is a map of names to hash IDs.
StringToOpcode is a map of opcodes to strings.
StringToRcode is a map of rcodes to strings.
StringToType is the reverse of TypeToString, needed for string parsing.
TypeToRR is a map of constructors for each RR type.
TypeToString is a map of strings for each RR type.
Version is current version of this library.

# Structs

A RR.
AAAA RR.
AFSDB RR.
ANY is a wild card record.
APL RR.
APLPrefix is an address prefix hold by an APL record.
AVC RR.
CAA RR.
CDNSKEY RR.
CDS RR.
CERT RR.
A Client defines parameters for a DNS client.
ClientConfig wraps the contents of the /etc/resolv.conf file.
CNAME RR.
A Conn represents a connection to a DNS server.
CSYNC RR.
DHCID RR.
DLV RR.
DNAME RR.
DNSKEY RR.
DS RR.
The EDNS0_COOKIE option is used to add a DNS Cookie to a message.
EDNS0_DUA implements the EDNS0 "DNSSEC Algorithm Understood" option.
EDNS0_DHU implements the EDNS0 "DS Hash Understood" option.
EDNS0_EXPIRE implementes the EDNS0 option as described in RFC 7314.
EDNS0_LLQ stands for Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 Implemented for completeness, as the EDNS0 type code is assigned.
The EDNS0_LOCAL option is used for local/experimental purposes.
EDNS0_N3U implements the EDNS0 "NSEC3 Hash Understood" option.
EDNS0_NSID option is used to retrieve a nameserver identifier.
EDNS0_PADDING option is used to add padding to a request/response.
EDNS0_SUBNET is the subnet option that is used to give the remote nameserver an idea of where the client lives.
EDNS0_TCP_KEEPALIVE is an EDNS0 option that instructs the server to keep the TCP connection alive.
The EDNS0_UL (Update Lease) (draft RFC) option is used to tell the server to set an expiration on an update RR.
EID RR.
Envelope is used when doing a zone transfer with a remote server.
Error represents a DNS error.
EUI48 RR.
EUI64 RR.
GID RR.
GPOS RR.
Header is the wire format for the DNS packet header.
HINFO RR.
HIP RR.
KEY RR.
KX RR.
L32 RR, See RFC 6742.
L64 RR, See RFC 6742.
LOC RR.
LP RR.
MB RR.
MD RR.
MF RR.
MG RR.
MINFO RR.
MR RR.
Msg contains the layout of a DNS message.
MsgHdr is a a manually-unpacked version of (id, bits).
MX RR.
NAPTR RR.
NID RR.
NIMLOC RR.
NINFO RR.
NS RR.
NSAPPTR RR.
NSEC RR.
NSEC3 RR.
NSEC3PARAM RR.
NULL RR.
OPENPGPKEY RR.
OPT is the EDNS0 RR appended to messages to convey extra (meta) information.
ParseError is a parsing error.
PrivateRR represents an RR that uses a PrivateRdata user-defined type.
PTR RR.
PX RR.
Question holds a DNS question.
RFC3597 represents an unknown/generic RR.
RKEY RR.
RP RR.
RR_Header is the header all DNS resource records share.
RRSIG RR.
RT RR.
ServeMux is an DNS request multiplexer.
A Server defines parameters for running an DNS server.
SessionUDP holds the remote address and the associated out-of-band data.
SIG RR.
SMIMEA RR.
SOA RR.
SPF RR.
SRV RR.
SSHFP RR.
TA RR.
TALINK RR.
TKEY RR.
TLSA RR.
Token holds the token that are returned when a zone file is parsed.
A Transfer defines parameters that are used during a zone transfer.
TSIG is the RR the holds the transaction signature of a message.
TXT RR.
UID RR.
UINFO RR.
URI RR.
X25 RR.
ZoneParser is a parser for an RFC 1035 style zonefile.

# Interfaces

A ConnectionStater interface is used by a DNS Handler to access TLS connection state when available.
EDNS0 defines an EDNS0 Option.
Handler is implemented by any value that implements ServeDNS.
PrivateRdata is an interface used for implementing "Private Use" RR types, see RFC 6895.
Reader reads raw DNS messages; each call to ReadTCP or ReadUDP should return an entire message.
A ResponseWriter interface is used by an DNS handler to construct an DNS response.
An RR represents a resource record.
Writer writes raw DNS messages; each call to Write should send an entire message.

# Type aliases

No description provided by the author
DecorateReader is a decorator hook for extending or supplanting the functionality of a Reader.
DecorateWriter is a decorator hook for extending or supplanting the functionality of a Writer.
The HandlerFunc type is an adapter to allow the use of ordinary functions as DNS handlers.
MsgAcceptAction represents the action to be taken.
MsgAcceptFunc is used early in the server code to accept or reject a message with RcodeFormatError.
No description provided by the author
No description provided by the author