deleg

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

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

Go to latest
Published: Dec 26, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

README

deleg

Name

deleg - Implements the DELEG record

Description

deleg implements the DELEG record. See draft-dnsop-deleg for details.

Syntax

For each Server Block, create a deleg block with the list of zones it handles and the responses to add for those delegations:

deleg zone1 zone2 {
    responses "example.org. 3600 IN TXT some text"
}

deleg zone3 {
  responses "example.org. 3600 IN TXT zone3 text"
}

NOTE: the owner of the deleg response will be overridden. This syntax is currently used for its simplcity.

Examples

In this example, we will serve the root zone and add records for the com and org delegations.

First, get a copy of the root zone:

dig axfr . @xfr.dns.icann.org > rootzone

set your Corefile as below

. {
  file rootzone
  deleg com org  {
    responses "example.org. 3600 IN TXT \"this is an example\"" "example.com. 3600 IN TXT this is an another example"
  }
  deleg net {
    responses "example.org.  86400  IN DELEG  1 ns1.example.com. ( ipv4hint=192.0.2.1 ipv6hint=2001:DB8::1 )"
  }
}

Start coredns:

./coredns -conf Corefile -dns.port 1053

and test:

dig @corednsserverip -p 1053 foo.org foo.net +noall +auth

Enabling the plugin

Add the deleg to the list of CoreDNS plugin, right after dnssec:

diff --git a/plugin.cfg b/plugin.cfg
index 532c3dda5..d400b99f4 100644
--- a/plugin.cfg
+++ b/plugin.cfg
@@ -49,6 +49,7 @@ cache:cache
 rewrite:rewrite
 header:header
 dnssec:dnssec
+deleg:github.com/chantra/coredns-deleg
 autopath:autopath
 minimal:minimal
 template:template

See Also

draft-dnsop-deleg.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deleg

type Deleg struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

Deleg is a plugin that implements https://github.com/fl1ger/deleg/blob/main/draft-dnsop-deleg.md

func (Deleg) Name

func (d Deleg) Name() string

Name implements the Handler interface.

func (Deleg) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

type ResponsePrinter

type ResponsePrinter struct {
	dns.ResponseWriter
	// contains filtered or unexported fields
}

ResponsePrinter wrap a dns.ResponseWriter and will write example to standard output when WriteMsg is called.

func NewResponsePrinter

func NewResponsePrinter(w dns.ResponseWriter, d Deleg) *ResponsePrinter

NewResponsePrinter returns ResponseWriter.

func (*ResponsePrinter) WriteMsg

func (r *ResponsePrinter) WriteMsg(res *dns.Msg) error

WriteMsg calls the underlying ResponseWriter's WriteMsg method and prints "example" to standard output.

Jump to

Keyboard shortcuts

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