coredns/plugin/whoami
Miek Gieben 84ec780ffc
New plugin: loop (#1989)
* New plugin: loop

Add a plugin that detects loops. It does this by sending an unique query
to our selves. If we see the query more than twice we stop the process.
If there isn't a loop, the plugin disables it self and becomes a noop
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 19:45:17 +01:00
..
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
OWNERS New plugin: loop (#1989) 2018-07-20 19:45:17 +01:00
README.md Remove trailing whitespace (#1955) 2018-07-09 08:08:02 -04:00
setup.go just use setup (#1574) 2018-02-28 19:56:14 -08:00
setup_test.go just use setup (#1574) 2018-02-28 19:56:14 -08:00
whoami.go Do Compress only when need in request.Scrub (#1760) 2018-05-01 21:04:06 +01:00
whoami_test.go all: fix plugin import ordering (#1717) 2018-04-22 08:34:35 +01:00

whoami

Name

whoami - returns your resolver's local IP address, port and transport.

Description

The whoami plugin is not really that useful, but can be used for having a simple (fast) endpoint to test clients against. When whoami returns a response it will have your client's IP address in the additional section as either an A or AAAA record.

The reply always has an empty answer section. The port and transport are included in the additional section as a SRV record, transport can be "tcp" or "udp".

._<transport>.qname. 0 IN SRV 0 0 <port> .

The whoami plugin will respond to every A or AAAA query, regardless of the query name.

If CoreDNS can't find a Corefile on startup this is the default plugin that gets loaded. As such it can be used to check that CoreDNS is responding to queries. Other than that this plugin is of limited use in production.

Syntax

whoami

Examples

Start a server on the default port and load the whoami plugin.

. {
    whoami
}

When queried for "example.org A", CoreDNS will respond with:

;; QUESTION SECTION:
;example.org.   IN       A

;; ADDITIONAL SECTION:
example.org.            0       IN      A       10.240.0.1
_udp.example.org.       0       IN      SRV     0 0 40212

See Also

Read the blog post on how this plugin is built, or explore the source code.