ipin

package module
v0.0.0-...-81d32b8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README


title: "ipin" description: "ipin returns IP address and port based on you domain name." weight: 10 tags: [ "plugin" , "ipin" ] categories: [ "plugin", "external" ] date: "2017-12-09T02:00:00+08:00" repo: "https://github.com/fil106/coredns-ipin" home: "https://github.com/fil106/coredns-ipin/blob/master/README.md"

ipin

ipin returns IP address and port based on you domain name. Your IP address is returned in the answer section, currently only support ipv4, so A record only.

The optional port are included in the additional section as a SRV record.

._port.qname. 0 IN SRV 0 0 <port> .

Syntax

ipin {
  // if pattern not match, keep processing
  fallback
}

Examples

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

. {
    ipin
}

When queried for "192-168-1-1.example.org A", CoreDNS will respond with:

;; QUESTION SECTION:
;192-168-1-1.example.org.	IN	A

;; ANSWER SECTION:
192-168-1-1.example.org. 0	IN	A	192.168.1.1

When queried for "127-0-0-1-8080.example.org A", CoreDNS will respond with:

;; QUESTION SECTION:
;127-0-0-1-8080.example.org.	IN	A

;; ANSWER SECTION:
127-0-0-1-8080.example.org. 0	IN	A	127.0.0.1

;; ADDITIONAL SECTION:
_port.127-0-0-1-8080.example.org. 0 IN	SRV	0 0 8080 .

Documentation

Overview

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

Index

Constants

View Source
const Name = "ipin"

Variables

This section is empty.

Functions

This section is empty.

Types

type IpInName

type IpInName struct {
	// When process failed, will call next plugin
	Fallback bool
	Ttl      uint32
	Next     plugin.Handler
}

func (IpInName) Name

func (self IpInName) Name() string

func (IpInName) Resolve

func (self IpInName) Resolve(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (*dns.Msg, int, error)

func (IpInName) ServeDNS

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

Jump to

Keyboard shortcuts

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