]>
Commit | Line | Data |
---|---|---|
20d81666 PL |
1 | Constants |
2 | ========= | |
3 | ||
4 | There are many constants in :program:`dnsdist`. | |
5 | ||
6 | .. _DNSOpcode: | |
7 | ||
8 | OPCode | |
9 | ------ | |
10 | ||
09b45aa8 PD |
11 | These constants represent the `OpCode <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-5>`__ of a query. |
12 | ||
20d81666 PL |
13 | - ``DNSOpcode.Query`` |
14 | - ``DNSOpcode.IQuery`` | |
15 | - ``DNSOpcode.Status`` | |
16 | - ``DNSOpcode.Notify`` | |
17 | - ``DNSOpcode.Update`` | |
18 | ||
d83feb68 CH |
19 | Reference: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-5 |
20 | ||
0bfb28ec | 21 | .. _DNSClass: |
20d81666 | 22 | |
0bfb28ec | 23 | DNSClass |
20d81666 PL |
24 | ------ |
25 | ||
09b45aa8 PD |
26 | These constants represent the `CLASS <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2>`__ of a DNS record. |
27 | ||
0bfb28ec | 28 | - ``DNSClass.IN`` |
29 | - ``DNSClass.CHAOS`` | |
30 | - ``DNSClass.NONE`` | |
31 | - ``DNSClass.ANY`` | |
20d81666 | 32 | |
d83feb68 CH |
33 | Reference: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2 |
34 | ||
20d81666 PL |
35 | .. _DNSRCode: |
36 | ||
37 | RCode | |
38 | ----- | |
39 | ||
09b45aa8 PD |
40 | These constants represent the different `RCODEs <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6>`__ for DNS messages. |
41 | ||
42 | .. versionchanged:: 1.4.0 | |
43 | The prefix is changed from ``dnsdist`` to ``DNSRCode``. | |
44 | ||
45 | - ``DNSRCode.NOERROR`` | |
46 | - ``DNSRCode.FORMERR`` | |
47 | - ``DNSRCode.SERVFAIL`` | |
48 | - ``DNSRCode.NXDOMAIN`` | |
49 | - ``DNSRCode.NOTIMP`` | |
50 | - ``DNSRCode.REFUSED`` | |
51 | - ``DNSRCode.YXDOMAIN`` | |
52 | - ``DNSRCode.YXRRSET`` | |
53 | - ``DNSRCode.NXRRSET`` | |
54 | - ``DNSRCode.NOTAUTH`` | |
55 | - ``DNSRCode.NOTZONE`` | |
56 | ||
57 | RCodes below are extended RCodes that can only be matched using :func:`ERCodeRule`. | |
58 | ||
59 | - ``DNSRCode.BADVERS`` | |
60 | - ``DNSRCode.BADSIG`` | |
61 | - ``DNSRCode.BADKEY`` | |
62 | - ``DNSRCode.BADTIME`` | |
63 | - ``DNSRCode.BADMODE`` | |
64 | - ``DNSRCode.BADNAME`` | |
65 | - ``DNSRCode.BADALG`` | |
66 | - ``DNSRCode.BADTRUNC`` | |
67 | - ``DNSRCode.BADCOOKIE`` | |
6bb92a06 PD |
68 | |
69 | .. _EDNSOptionCode: | |
70 | ||
71 | EDNSOptionCode | |
72 | -------------- | |
73 | ||
74 | - ``EDNSOptionCode.DHU`` | |
75 | - ``EDNSOptionCode.ECS`` | |
76 | - ``EDNSOptionCode.N3U`` | |
77 | - ``EDNSOptionCode.DAU`` | |
78 | - ``EDNSOptionCode.TCPKEEPALIVE`` | |
79 | - ``EDNSOptionCode.COOKIE`` | |
80 | - ``EDNSOptionCode.PADDING`` | |
81 | - ``EDNSOptionCode.KEYTAG`` | |
82 | - ``EDNSOptionCode.NSID`` | |
83 | - ``EDNSOptionCode.CHAIN`` | |
84 | - ``EDNSOptionCode.EXPIRE`` | |
85 | ||
86 | Reference: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-11 | |
87 | ||
20d81666 PL |
88 | .. _DNSSection: |
89 | ||
09b45aa8 PD |
90 | DNS Packet Sections |
91 | ------------------- | |
92 | ||
93 | These constants represent the section in the DNS Packet. | |
20d81666 PL |
94 | |
95 | - ``DNSSection.Question`` | |
96 | - ``DNSSection.Answer`` | |
97 | - ``DNSSection.Authority`` | |
98 | - ``DNSSection.Additional`` | |
99 | ||
100 | .. _DNSAction: | |
101 | ||
102 | DNSAction | |
103 | --------- | |
104 | ||
955de53b | 105 | These constants represent an Action that can be returned from :func:`LuaAction` functions. |
20d81666 PL |
106 | |
107 | * ``DNSAction.Allow``: let the query pass, skipping other rules | |
108 | * ``DNSAction.Delay``: delay the response for the specified milliseconds (UDP-only), continue to the next rule | |
109 | * ``DNSAction.Drop``: drop the query | |
110 | * ``DNSAction.HeaderModify``: indicate that the query has been turned into a response | |
111 | * ``DNSAction.None``: continue to the next rule | |
477c86a0 | 112 | * ``DNSAction.NoOp``: continue to the next rule (used for Dynamic Block actions where None has a different meaning) |
20d81666 PL |
113 | * ``DNSAction.Nxdomain``: return a response with a NXDomain rcode |
114 | * ``DNSAction.Pool``: use the specified pool to forward this query | |
115 | * ``DNSAction.Refused``: return a response with a Refused rcode | |
fbd6b779 | 116 | * ``DNSAction.ServFail``: return a response with a ServFail rcode |
20d81666 | 117 | * ``DNSAction.Spoof``: spoof the response using the supplied IPv4 (A), IPv6 (AAAA) or string (CNAME) value |
fbd6b779 | 118 | * ``DNSAction.Truncate``: truncate the response |
3d60b39a | 119 | * ``DNSAction.NoRecurse``: set rd=0 on the query |
fbd6b779 | 120 | |
09b45aa8 PD |
121 | .. _DNSQType: |
122 | ||
123 | DNSQType | |
124 | -------- | |
125 | ||
126 | .. versionchanged:: 1.3.0 | |
127 | The prefix is changed from ``dnsdist.`` to ``DNSQType``. | |
128 | ||
129 | All named `QTypes <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4>`__ are available as constants, prefixed with ``DNSQType.``, e.g.: | |
130 | ||
131 | * ``DNSQType.AAAA`` | |
132 | * ``DNSQType.AXFR`` | |
133 | * ``DNSQType.A`` | |
134 | * ``DNSQType.NS`` | |
135 | * ``DNSQType.SOA`` | |
136 | * etc. | |
fbd6b779 CHB |
137 | |
138 | .. _DNSResponseAction: | |
139 | ||
140 | DNSResponseAction | |
141 | ----------------- | |
142 | ||
955de53b | 143 | These constants represent an Action that can be returned from :func:`LuaResponseAction` functions. |
fbd6b779 | 144 | |
0b3789ef | 145 | * ``DNSResponseAction.Allow``: let the response pass, skipping other rules |
fbd6b779 | 146 | * ``DNSResponseAction.Delay``: delay the response for the specified milliseconds (UDP-only), continue to the next rule |
0b3789ef | 147 | * ``DNSResponseAction.Drop``: drop the response |
fbd6b779 CHB |
148 | * ``DNSResponseAction.HeaderModify``: indicate that the query has been turned into a response |
149 | * ``DNSResponseAction.None``: continue to the next rule | |
150 | * ``DNSResponseAction.ServFail``: return a response with a ServFail rcode |