dn42

package module
v0.0.0-...-7528018 Latest Latest
Warning

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

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

README

CoreDNS-DN42

A CoreDNS plugin for serving the DN42 registry.

This plugin acts as an authoritative server. It returns NS & DS records for forward zones and reverse IPv4/IPv6 zones in DN42 registry. It doesn't do any recursion, you need a separate DNS resolver for that.

WARNING

This plugin is experimental. While it appears to work for forward and reverse IPv4/IPv6 DNS, it isn't fully compliant with DNS protocol specs. Compatibility with DNS clients isn't guaranteed.

Compilation

In your cloned CoreDNS repository:

  1. Add dn42:github.com/xddxdd/coredns-dn42 to the end of plugin.cfg
  2. go get github.com/xddxdd/coredns-dn42
  3. go generate
  4. go build

Usage

. {
  dn42 "/path/to/dn42/registry" 900
}

First argument (mandatory) is the path to DN42 registry. Inside the registry path, there should be a data folder containing all IPs and domains.

Second argument (optional) is the default TTL. If unset, default TTL is 3600.

License

Apache 2.0 license.

Documentation

Index

Constants

View Source
const DS_PREFIX = "ds-rdata:           "
View Source
const IPv4_PTR_SUFFIX = ".in-addr.arpa."
View Source
const IPv6_PTR_SUFFIX = ".ip6.arpa."
View Source
const NS_PREFIX = "nserver:            "

Variables

This section is empty.

Functions

This section is empty.

Types

type DN42

type DN42 struct {
	DN42RegistryPath string
	Ttl              uint32
	Next             plugin.Handler
}

func (DN42) Name

func (dn42 DN42) Name() string

Name implements the Handler interface.

func (DN42) Ready

func (dn42 DN42) Ready() bool

Ready implements the ready.Readiness interface, once this flips to true CoreDNS assumes this plugin is ready for queries; it is not checked again.

func (DN42) ServeDNS

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

ServeDNS implements the plugin.Handler interface. This method gets called when example is used in a Server.

Jump to

Keyboard shortcuts

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