*header* - modifies the header for queries and responses.
## Description
## Description
*header* ensures that the flags are in the desired state for responses. The modifications are made transparently for
*header* ensures that the flags are in the desired state for queries and responses.
the client.
The modifications are made transparently for the client and subsequent plugins.
## Syntax
## Syntax
~~~
~~~
header {
header {
ACTION FLAGS...
[SELECTOR] ACTION FLAGS...
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
***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:
most precedence. Allowed values are:
*`set`
*`set`
...
@@ -34,7 +36,7 @@ Make sure recursive available `ra` flag is set in all the responses:
...
@@ -34,7 +36,7 @@ Make sure recursive available `ra` flag is set in all the responses:
~~~ corefile
~~~ corefile
. {
. {
header {
header {
set ra
response set ra
}
}
}
}
~~~
~~~
...
@@ -44,8 +46,18 @@ Make sure "recursion available" `ra` and "authoritative answer" `aa` flags are s
...
@@ -44,8 +46,18 @@ Make sure "recursion available" `ra` and "authoritative answer" `aa` flags are s
~~~ corefile
~~~ corefile
. {
. {
header {
header {
set ra aa
response set ra aa
clear rd
response clear rd
}
}
~~~
Make sure "recursion desired" `rd` is set for all subsequent plugins::