diff --git a/README.md b/README.md index 135795d..201f380 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Features: - Support for DNS-over-TLS (DoT) - Support for DNS-over-HTTPS (DoH) -- Support for plain DNS, UDP and TCP for incoming and outgoing traffic +- Support for plain DNS, UDP and TCP for incoming and outgoing requests - Connection reuse and pipelining queries for efficiency - Multiple failover and load-balancing algorithms - Routing of queries based on type and/or query name diff --git a/doc.go b/doc.go index 3a2a6bb..6697c98 100644 --- a/doc.go +++ b/doc.go @@ -27,5 +27,13 @@ Listeners While resolvers handle outgoing queries to upstream servers, listeners are the receivers of queries. Multiple listeners can be started for different protocols and on different ports. Each listener forwards received queries to one resolver, group, or router. + +This example starts a stub resolver on the local machine which will forward all queries +via DNS-over-TLS to provide privacy. + + r := rdns.NewDoTClient("1.1.1.1:853") + l := rdns.NewDNSListener("127.0.0.1:53", "udp", r) + panic(l.Start()) + */ package rdns diff --git a/router.go b/router.go index cb3c2ea..bb8b8a8 100644 --- a/router.go +++ b/router.go @@ -44,7 +44,8 @@ func (r *Router) Resolve(q *dns.Msg) (*dns.Msg, error) { // Add a new route to the router. New routes are appended to the existing // ones and are evaluated in the same order they're added. The default // route (no name, no type) should be added last since subsequently added -// routes won't have any impact. +// routes won't have any impact. Name is a regular expression that is +// applied to the name in the first question section of the DNS message. func (r *Router) Add(name, typ string, resolver Resolver) error { t, err := stringToType(typ) if err != nil {