mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
For some reasons there was a dnsserver/middleware.go that defined the middleware handlers. This code was a repeat from middleware/middleware.go. Removed dnsserver/middleware.go and replaced all uses of dnsserver.Middleware with middleware.Middleware. Added dnsserver/address_test.go to test the zone normalization (and to improve the test coverage). The deleted file will also improve the test coverage :)
whoami
whoami returns your local IP address, port and transport used. Your local IP address is returned in the additional section as either an A or AAAA record.
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 middleware will respond to every A or AAAA query, regardless of the query name.
Syntax
whoami
Examples
.:53 {
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