mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
plugin/metadata: finish documentation (#1951)
* plugin/metadata: finish documentation Finish the README.md, add corner case in the IsLabel test and reword some code comments slightly. Generate the man-pages and add man/coredns-metadata.7 as well. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix test Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -306,12 +306,16 @@ rewrites the first local option with code 0xffee, setting the data to "abcd"\. E
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.TP
|
||||
A variable data is specified with a pair of curly brackets \fB{}\fR\. Following are the supported variables
|
||||
{qname}, {qtype}, {client_ip}, {client_port}, {protocol}, {server_ip}, {server_port}\.
|
||||
.IP "\(bu" 4
|
||||
A variable data is specified with a pair of curly brackets \fB{}\fR\. Following are the supported variables: {qname}, {qtype}, {client_ip}, {client_port}, {protocol}, {server_ip}, {server_port}\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
If the metadata plugin is enabled, then labels are supported as variables if they are presented within curly brackets\. the variable data will be filled with the value associated with that label\. If that label is not provided, the variable will be silently substitute by an empty string\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Example:
|
||||
Examples:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
@@ -323,6 +327,21 @@ rewrite edns0 local set 0xffee {client_ip}
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The following example uses metadata and an imaginary "some\-plugin" that would provide "some\-label" as metadata information\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
metadata
|
||||
some\-plugin
|
||||
rewrite edns0 local set 0xffee {some\-plugin/some\-label}
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SS "EDNS0_NSID"
|
||||
This has no fields; it will add an NSID option with an empty string for the NSID\. If the option already exists and the action is \fBreplace\fR or \fBset\fR, then the NSID in the option will be set to the empty string\.
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user