mirror of
https://github.com/coredns/coredns.git
synced 2026-02-01 04:53:10 -05:00
plugin/metadata: metadata is just label=value (#1914)
This revert 17d807f0 and re-adds the metadata plugin as a plugin that
just sets a label to a value function.
Add package documentation on how to use the metadata package. Make it
clear that any caching is up to the Func implemented.
There are now - no in tree users. We could add the request metadata by
default under names that copy request.Request, i.e
request/ip - remote IP
request/port - remote port
Variables.go has been deleted.
Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -206,17 +206,13 @@ rewrites the first local option with code 0xffee, setting the data to "abcd". Eq
|
||||
}
|
||||
~~~
|
||||
|
||||
* A variable data is specified with a pair of curly brackets `{}`. Following are the supported variables by default:
|
||||
* A variable data is specified with a pair of curly brackets `{}`. Following are the supported variables:
|
||||
{qname}, {qtype}, {client_ip}, {client_port}, {protocol}, {server_ip}, {server_port}.
|
||||
Any plugin that can provide it's own additional variables by implementing metadata.Provider interface. If you are going to use metadata variables then metadata plugin must be enabled.
|
||||
|
||||
Example:
|
||||
|
||||
~~~ corefile
|
||||
. {
|
||||
metadata
|
||||
rewrite edns0 local set 0xffee {client_ip}
|
||||
}
|
||||
~~~
|
||||
rewrite edns0 local set 0xffee {client_ip}
|
||||
~~~
|
||||
|
||||
### EDNS0_NSID
|
||||
|
||||
Reference in New Issue
Block a user