nametoip

package module
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

nametoip

nametoip is a plugin for CoreDNS that returns IP addresses encoded in hostnames. It is intended for local development, home labs etc... It provides functionality similar to services like nip.io and sslip.io.

It provides the following encodings:

  • Dot notation. eg:
    • 10.2.3.4.example.com resolves to 10.2.3.4
  • Dash notation. eg:
    • 10-2-3-4.example.com resolves to 10.2.3.4
  • Hex notation. eg:
    • 0a020304.example.com resolves to 10.2.3.4
  • (Optional) vanity notation. eg:
    • quxac.example.com resolves to 192.168.0.1 (with )
  • Above encodings allow for arbitrary prefixes and subdomains. eg:
    • a.big.hello-world-10-2-3-4.example.com resolves to 10.2.3.4

For now, only private IPs are supported as this plugin is intended to support scenarios such as home labs, local development etc...

Vanity names

Optional vanity names can also be used. These are 5 character CVCVC words (C=consonant, V=vowel) and are somewhat pronounceable.

This word list needs to be supplied (see ./Corefile) and is hard-coded to the 192.168. address space. The file should cover the 16 bit address space as the line number is mapped to the base address. If you only care about, say, 192.168.0.0-192.168.10.255, then you will only need a file with 11 x 256 lines.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameToIp

type NameToIp struct {
	Next       plugin.Handler
	Origins    []string
	VanityName map[string]int
	// contains filtered or unexported fields
}

func (NameToIp) Name

func (n NameToIp) Name() string

func (NameToIp) Ready

func (n NameToIp) Ready() bool

func (NameToIp) ServeDNS

func (n NameToIp) ServeDNS(ctx context.Context, writer dns.ResponseWriter, msg *dns.Msg) (int, error)

Jump to

Keyboard shortcuts

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