aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-12-09 09:37:02 +0000
committerGravatar GitHub <noreply@github.com> 2017-12-09 09:37:02 +0000
commitcf5418a0155049ad492c8b01547f4f6598ccdfdf (patch)
tree21413fce6208dd9aee5d0955599c824b33c98a3d
parent850a0249054de1c6498504983cdcb208edf9cce3 (diff)
downloadcoredns-cf5418a0155049ad492c8b01547f4f6598ccdfdf.tar.gz
coredns-cf5418a0155049ad492c8b01547f4f6598ccdfdf.tar.zst
coredns-cf5418a0155049ad492c8b01547f4f6598ccdfdf.zip
plugin/nsid: Small doc cleanup (#1293)
add an example and some typos fixed.
-rw-r--r--plugin/nsid/README.md25
-rw-r--r--plugin/nsid/nsid.go1
2 files changed, 22 insertions, 4 deletions
diff --git a/plugin/nsid/README.md b/plugin/nsid/README.md
index 4f7cf081c..7ba381280 100644
--- a/plugin/nsid/README.md
+++ b/plugin/nsid/README.md
@@ -1,9 +1,9 @@
# nsid
-*nsid* add an identifier of this server to each reply.
+*nsid* adds an identifier of this server to each reply.
This plugin implements RFC 5001 and adds an EDNS0 OPT resource record to replies that uniquely
-identifies the server. This can be useful in anycast setups to see which server was responsible for
+identify the server. This is useful in anycast setups to see which server was responsible for
generating the reply and for debugging.
## Syntax
@@ -22,6 +22,25 @@ Enable nsid:
~~~ corefile
. {
- nsid
+ whoami
+ nsid Use The Force
}
~~~
+
+And now a client with NSID support will see an OPT record with the NSID option:
+
+~~~ sh
+% dig +nsid @localhost a whoami.example.org
+
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46880
+;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 3
+
+....
+
+; OPT PSEUDOSECTION:
+; EDNS: version: 0, flags:; udp: 4096
+; NSID: 55 73 65 20 54 68 65 20 46 6f 72 63 65 ("Use The Force")
+;; QUESTION SECTION:
+;whoami.example.org. IN A
+~~~
diff --git a/plugin/nsid/nsid.go b/plugin/nsid/nsid.go
index 728c14bdd..ebd3a48dc 100644
--- a/plugin/nsid/nsid.go
+++ b/plugin/nsid/nsid.go
@@ -29,7 +29,6 @@ func (n Nsid) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
if _, ok := o.(*dns.EDNS0_NSID); ok {
nw := &ResponseWriter{ResponseWriter: w, Data: n.Data}
return plugin.NextOrFailure(n.Name(), n.Next, ctx, nw, r)
-
}
}
}