mirror of
https://github.com/coredns/coredns.git
synced 2025-12-05 09:55:10 -05:00
@@ -2,22 +2,24 @@
|
||||
|
||||
## Name
|
||||
|
||||
*header* - modifies the header for responses.
|
||||
*header* - modifies the header for queries and responses.
|
||||
|
||||
## Description
|
||||
|
||||
*header* ensures that the flags are in the desired state for responses. The modifications are made transparently for
|
||||
the client.
|
||||
*header* ensures that the flags are in the desired state for queries and responses.
|
||||
The modifications are made transparently for the client and subsequent plugins.
|
||||
|
||||
## Syntax
|
||||
|
||||
~~~
|
||||
header {
|
||||
ACTION FLAGS...
|
||||
ACTION FLAGS...
|
||||
[SELECTOR] ACTION FLAGS...
|
||||
[SELECTOR] ACTION FLAGS...
|
||||
}
|
||||
~~~
|
||||
|
||||
* **SELECTOR** defines if the action should be applied on `query` or `response`. In future CoreDNS version the selector will be mandatory. For backwards compatibility the action will be applied on `response` if the selector is undefined.
|
||||
|
||||
* **ACTION** defines the state for DNS message header flags. Actions are evaluated in the order they are defined so last one has the
|
||||
most precedence. Allowed values are:
|
||||
* `set`
|
||||
@@ -34,7 +36,7 @@ Make sure recursive available `ra` flag is set in all the responses:
|
||||
~~~ corefile
|
||||
. {
|
||||
header {
|
||||
set ra
|
||||
response set ra
|
||||
}
|
||||
}
|
||||
~~~
|
||||
@@ -44,8 +46,18 @@ Make sure "recursion available" `ra` and "authoritative answer" `aa` flags are s
|
||||
~~~ corefile
|
||||
. {
|
||||
header {
|
||||
set ra aa
|
||||
clear rd
|
||||
response set ra aa
|
||||
response clear rd
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
Make sure "recursion desired" `rd` is set for all subsequent plugins::
|
||||
|
||||
~~~ corefile
|
||||
. {
|
||||
header {
|
||||
query set rd
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user