autoipv6ptr

package
v0.0.0-...-dba2aa3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: GPL-3.0, Apache-2.0 Imports: 9 Imported by: 0

README

coredns-auto-ipv6-ptr

Goal: Generate IPv6 PTR records on the fly.

Additional benefit: Works with known hosts.

Examples

Generate PTR records if not found in a zonefile
0.0.0.b.0.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa {
    autoipv6ptr {
        suffix lan.mydomain.tld
    }
    file your.reverse.zone
    log
}
Same as above but with a transferred zone
1.0.0.b.0.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa {
    autoipv6ptr {
        suffix servers.mydomain.tld
        ttl 60
    }
    secondary {
        transfer from your.master.dns
    }
    log
}

Order is everything!

It's necessary that file or secondary comes right after autoipv6ptr! This plugin always calls the next plugin and checks its return. It will only generate a PTR if a negative result comes back.

Building a ready-to-use coredns binary using Docker

Using the docker infrastructure it's easy for you to build a working binary with the plugin:

docker build --pull --no-cache --output type=local,dest=result -f Dockerfile.build .

If everything checks out you'll find an x86_64 binary locally under result/coredns.

Testing

Run:

./result/coredns -conf tests/Corefile -p 1337

Test with dig. Known record:

dig @::1 -p 1337 +short -x 2001:db8:300::10
success.example.com.

Unknown record:

dig @::1 -p 1337 +short -x 2001:db8:300::11
20010db8030000000000000000000011.example.com.

Sourced from https://github.com/vlcty/coredns-auto-ipv6-ptr.

Documentation

Index

Constants

View Source
const AUTOIPV6PTR_PLUGIN_NAME string = "autoipv6ptr"

Variables

This section is empty.

Functions

func RemoveDots

func RemoveDots(input string) string

func RemoveIP6DotArpa

func RemoveIP6DotArpa(input string) string

func ReverseString

func ReverseString(input string) string

Types

type AutoIPv6PTR

type AutoIPv6PTR struct {
	Next plugin.Handler

	TTL uint32

	Suffix string
}

func (AutoIPv6PTR) Name

func (a AutoIPv6PTR) Name() string

func (AutoIPv6PTR) ServeDNS

func (v6ptr AutoIPv6PTR) ServeDNS(ctx context.Context, writer dns.ResponseWriter, request *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface.

Jump to

Keyboard shortcuts

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