Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
cf5418a0
Commit
cf5418a0
authored
Dec 09, 2017
by
Miek Gieben
Committed by
GitHub
Dec 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin/nsid: Small doc cleanup (#1293)
add an example and some typos fixed.
parent
850a0249
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
plugin/nsid/README.md
plugin/nsid/README.md
+22
-3
plugin/nsid/nsid.go
plugin/nsid/nsid.go
+0
-1
No files found.
plugin/nsid/README.md
View file @
cf5418a0
# nsid
# nsid
*nsid*
add an identifier of this server to each reply.
*nsid*
add
s
an identifier of this server to each reply.
This plugin implements RFC 5001 and adds an EDNS0 OPT resource record to replies that uniquely
This plugin implements RFC 5001 and adds an EDNS0 OPT resource record to replies that uniquely
identif
ies the server. This can be
useful in anycast setups to see which server was responsible for
identif
y the server. This is
useful in anycast setups to see which server was responsible for
generating the reply and for debugging.
generating the reply and for debugging.
## Syntax
## Syntax
...
@@ -22,6 +22,25 @@ Enable nsid:
...
@@ -22,6 +22,25 @@ Enable nsid:
~~~
corefile
~~~
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
~~~
plugin/nsid/nsid.go
View file @
cf5418a0
...
@@ -29,7 +29,6 @@ func (n Nsid) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
...
@@ -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
{
if
_
,
ok
:=
o
.
(
*
dns
.
EDNS0_NSID
);
ok
{
nw
:=
&
ResponseWriter
{
ResponseWriter
:
w
,
Data
:
n
.
Data
}
nw
:=
&
ResponseWriter
{
ResponseWriter
:
w
,
Data
:
n
.
Data
}
return
plugin
.
NextOrFailure
(
n
.
Name
(),
n
.
Next
,
ctx
,
nw
,
r
)
return
plugin
.
NextOrFailure
(
n
.
Name
(),
n
.
Next
,
ctx
,
nw
,
r
)
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment