Debian Codegraph @

cmd/atomdns/handlers/nsid/README.md

raw
1 # Name
2
3 _nsid_ - adds an identifier of this server to each reply
4
5 # Description
6
7 This handler implements RFC 5001 and adds an option code to replies that
8 uniquely identify the server. This is useful in anycast setups to see which server was responsible for
9 generating the reply and for debugging.
10
11 # Syntax
12
13 ```txt
14 nsid [DATA]
15 ```
16
17 Where **DATA** is the string to use in the nsid record. If **DATA** is not given, the host's name is used.
18
19 # Examples
20
21 Enable nsid:
22
23 ```conffile
24 example.org {
25 nsid Use the force
26 whoami
27 }
28 ```
29
30 And now a client with NSID support will see an OPT record with the NSID option:
31
32 ```sh
33 % dig +nsid @localhost a whoami.example.org
34
35 ;; Got answer:
36 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46880
37 ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 3
38
39 ....
40
41 ; OPT PSEUDOSECTION:
42 ; EDNS: version: 0, flags:; udp: 4096
43 ; NSID: 55 73 65 20 54 68 65 20 46 6f 72 63 65 ("Use The Force")
44 ;; QUESTION SECTION:
45 ;whoami.example.org. IN A
46 ```
47
48 # Context
49
50 The _nsid_ handler adds a single key to the context:
51
52 | Key | Type | Example | Description |
53 | :------------- | :----- | :------ | :------------------------------------------- |
54 | `nsid/msgfunc` | `func` | | Function that adds nsid option to the reply. |
55
56 # See Also
57
58 RFC 5001.