From bfd86012221c91df2a9a82a02e6e9a6ab70bd323 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 19 Dec 2019 09:28:37 +0000 Subject: [PATCH] Doc fixes (#1060) * Doc fixes Polish the docs a bit; fix a link to miek.nl, remove edns0client subnet draft link and point to the RFC. Some layout fixes and pull GOPATH from the readme as we do go modules now. Signed-off-by: Miek Gieben * review comments Signed-off-by: Miek Gieben --- README.md | 4 ++-- acceptfunc.go | 9 ++++++++- doc.go | 9 ++++----- duplicate.go | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index de4afed6..3a6e1cc3 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,8 @@ DNS Authors 2012- # Building -Building is done with the `go` tool. If you have setup your GOPATH correctly, the following should -work: +This library uses Go modules and uses semantic versioning. Building is done with the `go` tool, so +the following should work: go get github.com/miekg/dns go build github.com/miekg/dns diff --git a/acceptfunc.go b/acceptfunc.go index eba7dcd5..825617fe 100644 --- a/acceptfunc.go +++ b/acceptfunc.go @@ -6,13 +6,20 @@ type MsgAcceptFunc func(dh Header) MsgAcceptAction // DefaultMsgAcceptFunc checks the request and will reject if: // -// * isn't a request (don't respond in that case). +// * 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 +// var DefaultMsgAcceptFunc MsgAcceptFunc = defaultMsgAcceptFunc // MsgAcceptAction represents the action to be taken. diff --git a/doc.go b/doc.go index d3d7cec9..3318b77e 100644 --- a/doc.go +++ b/doc.go @@ -83,7 +83,7 @@ with: in, err := dns.Exchange(m1, "127.0.0.1:53") -When this functions returns you will get dns message. A dns message consists +When this functions returns you will get DNS message. A DNS message consists out of four sections. The question section: in.Question, the answer section: in.Answer, the authority section: in.Ns and the additional section: in.Extra. @@ -221,7 +221,7 @@ RFC 6895 sets aside a range of type codes for private use. This range is 65,280 - 65,534 (0xFF00 - 0xFFFE). When experimenting with new Resource Records these can be used, before requesting an official type code from IANA. -See https://miek.nl/2014/September/21/idn-and-private-rr-in-go-dns/ for more +See https://miek.nl/2014/september/21/idn-and-private-rr-in-go-dns/ for more information. EDNS0 @@ -238,9 +238,8 @@ Basic use pattern for creating an (empty) OPT RR: The rdata of an OPT RR consists out of a slice of EDNS0 (RFC 6891) interfaces. Currently only a few have been standardized: EDNS0_NSID (RFC 5001) and -EDNS0_SUBNET (draft-vandergaast-edns-client-subnet-02). Note that these options -may be combined in an OPT RR. Basic use pattern for a server to check if (and -which) options are set: +EDNS0_SUBNET (RFC 7871). Note that these options may be combined in an OPT RR. +Basic use pattern for a server to check if (and which) options are set: // o is a dns.OPT for _, s := range o.Option { diff --git a/duplicate.go b/duplicate.go index 00cda0aa..49e6940b 100644 --- a/duplicate.go +++ b/duplicate.go @@ -5,7 +5,7 @@ package dns // IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL. // So this means the header data is equal *and* the RDATA is the same. Return true // is so, otherwise false. -// It's is a protocol violation to have identical RRs in a message. +// It's a protocol violation to have identical RRs in a message. func IsDuplicate(r1, r2 RR) bool { // Check whether the record header is identical. if !r1.Header().isDuplicate(r2.Header()) {