2017-07-29 08:17:24 +00:00
|
|
|
# example
|
|
|
|
|
2018-02-22 14:06:00 +00:00
|
|
|
## Name
|
2018-02-22 14:05:25 +00:00
|
|
|
|
2019-08-15 08:18:00 +00:00
|
|
|
*example* - prints "example" on every query handled.
|
2018-02-22 14:05:25 +00:00
|
|
|
|
|
|
|
## Description
|
|
|
|
|
2019-08-15 08:18:00 +00:00
|
|
|
The example plugin prints "example" on every query that go handled by the server. It serves as
|
|
|
|
documentation for writing CoreDNS plugins.
|
2017-07-29 08:17:24 +00:00
|
|
|
|
|
|
|
## Syntax
|
|
|
|
|
|
|
|
~~~ txt
|
|
|
|
example
|
|
|
|
~~~
|
|
|
|
|
2018-04-01 11:56:41 +00:00
|
|
|
## Metrics
|
|
|
|
|
|
|
|
If monitoring is enabled (via the *prometheus* directive) the following metric is exported:
|
|
|
|
|
|
|
|
* `coredns_example_request_count_total{server}` - query count to the *example* plugin.
|
|
|
|
|
2018-04-27 06:15:14 +00:00
|
|
|
The `server` label indicated which server handled the request, see the *metrics* plugin for details.
|
|
|
|
|
2019-09-24 06:16:55 +00:00
|
|
|
## Ready
|
2018-04-27 06:21:42 +00:00
|
|
|
|
2019-09-24 06:16:55 +00:00
|
|
|
This plugin reports readiness to the ready plugin. It will be immediately ready.
|
2018-04-27 06:21:42 +00:00
|
|
|
|
2017-07-29 08:17:24 +00:00
|
|
|
## Examples
|
|
|
|
|
2018-04-27 06:15:14 +00:00
|
|
|
In this configuration, we forward all queries to 9.9.9.9 and print "example" whenever we receive
|
2018-02-22 14:05:25 +00:00
|
|
|
a query.
|
|
|
|
|
2019-03-30 18:22:25 +00:00
|
|
|
~~~ corefile
|
2018-02-22 14:05:25 +00:00
|
|
|
. {
|
|
|
|
forward . 9.9.9.9
|
2017-07-29 08:17:24 +00:00
|
|
|
example
|
|
|
|
}
|
2019-03-30 18:22:25 +00:00
|
|
|
~~~
|
2018-04-01 11:56:41 +00:00
|
|
|
|
|
|
|
## Also See
|
|
|
|
|
|
|
|
See the [manual](https://coredns.io/manual).
|