whoami

package
v0.0.0-...-5ac6020 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

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

Documentation

Overview

Package whoami implements a middleware that returns details about the resolving querying it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Whoami

type Whoami struct{}

Whoami is a middleware that returns your IP address, port and the protocol used for connecting to CoreDNS.

func (Whoami) Name

func (wh Whoami) Name() string

Name implements the Handler interface.

func (Whoami) ServeDNS

func (wh Whoami) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the middleware.Handler interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL