Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some more docs

A per Ask's request add some docs on how a server should deal
with EDNS0 options in the OPT RR.

closes #27
  • Loading branch information...
commit 795b6cb581c6407f353a68bfba835dadce0fbf8c 1 parent 379cb24
@miekg authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 edns.go
View
17 edns.go
@@ -8,6 +8,20 @@
// o.Hdr.Name = "."
// o.Hdr.Rrtype = dns.TypeOPT
//
+// The rdata of an OPT RR consists out of a slice of EDNS0 interfaces. Currently
+// only a few have been standardized: EDNS0_NSID (RFC 5001) and EDNS0_SUBNET (draft). 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.RR_OPT
+// for _, s := range o.Options {
+// switch e := s.(type) {
+// case *dns.EDNS0_NSID:
+// // do stuff with e.Nsid
+// case *dns.EDNS0_SUBNET:
+// // access e.Family, e.Address, etc.
+// }
+// }
package dns
import (
@@ -130,7 +144,8 @@ type EDNS0 interface {
}
// The nsid EDNS0 option is used to retrieve some sort of nameserver
-// identifier. The identifier is an opaque string encoded as hex.
+// identifier. When seding a request Nsid must be set to the empty string
+// The identifier is an opaque string encoded as hex.
// Basic use pattern for creating an nsid option:
//
// o := new(dns.RR_OPT)
Please sign in to comment.
Something went wrong with that request. Please try again.