package
0.0.0-20230705191951-b0482357d067
Repository: https://github.com/afula/dnsproxy.git
Documentation: pkg.go.dev

# Functions

CheckDisabledAAAARequest checks if AAAA requests should be disabled or not and sets NoError empty response to given DNSContext if needed.
GenEmptyMessage generates empty message with given response code and retry time.
ParseUpstreamsConfig returns UpstreamConfig and error if upstreams configuration is invalid default upstream syntax: <upstreamString> reserved upstream syntax: [/domain1/../domainN/]<upstreamString> subdomains only upstream syntax: [/*.domain1/../*.domainN]<upstreamString> More specific domains take priority over less specific domains, To exclude more specific domains from reserved upstreams querying you should use the following syntax: [/domain1/../domainN/]# So the following config: ["[/host.com/]1.2.3.4", "[/www.host.com/]2.3.4.5", "[/maps.host.com/]#", "3.4.5.6"] will send queries for *.host.com to 1.2.3.4, except for *.www.host.com, which will go to 2.3.4.5 and *.maps.host.com, which will go to default server 3.4.5.6 with all other domains.

# Constants

DoQCodeInternalError signals that the DoQ implementation encountered an internal error and is incapable of pursuing the transaction or the connection.
DoQCodeNoError is used when the connection or stream needs to be closed, but there is no error to signal.
DoQCodeProtocolError signals that the DoQ implementation encountered a protocol error and is forcibly aborting the connection.
DoQv1 represents DoQ v1.0: https://www.rfc-editor.org/rfc/rfc9250.html.
DoQv1Draft represents old DoQ draft versions that do not send a 2-octet prefix with the DNS message length.
ErrEmptyHost is returned by LookupIPAddr when the host is empty and can't be resolved.
NAT64PrefixLength is the length of a NAT64 prefix in bytes.
NextProtoDQ is the ALPN token for DoQ.
ProtoDNSCrypt is the DNSCrypt protocol.
ProtoHTTPS is the DNS-over-HTTPS (DoH) protocol.
ProtoQUIC is the DNS-over-QUIC (DoQ) protocol.
ProtoTCP is the plain DNS-over-TCP protocol.
ProtoTLS is the DNS-over-TLS (DoT) protocol.
ProtoUDP is the plain DNS-over-UDP protocol.
ServFailMaxCacheTTL is the maximum time-to-live value for caching SERVFAIL responses in seconds.
UModeFastestAddr - use Fastest Address algorithm.
UModeLoadBalance - LoadBalance.
UModeParallel - parallel queries to all configured upstream servers are enabled.
UnqualifiedNames is reserved name for "unqualified names only", ie names without dots.

# Structs

Config contains all the fields necessary for proxy configuration.
DNSContext represents a DNS request message context.
Proxy combines the proxy server state and configuration.
UpstreamConfig is a wrapper for list of default upstreams and map of reserved domains and corresponding upstreams.

# Type aliases

BeforeRequestHandler is an optional custom handler called before DNS requests If it returns false, the request won't be processed at all.
DoQVersion is an enumeration with supported DoQ versions.
Proto is the DNS protocol.
RequestHandler is an optional custom handler for DNS requests It is called instead of the default method (Proxy.Resolve()) See handler_test.go for examples.
ResponseHandler is a callback method that is called when DNS query has been processed d -- current DNS query context (contains response if it was successful) err -- error (if any).
UpstreamModeType - upstream mode.