siit

package
v1.15.0 Latest Latest
Warning

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

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

README

siit

Name

siit - enables AAAA->A translation support for DNS records based on SIIT (IPv6->IPv4 translation).

Description

The siit plugin will when asked for a domain's A record, synthesizes it from a corresponding AAAA record if it belongs to a certain IP range.

It also supports arbitrary mapping IPv6->IPv4.

It is useful when published services are IPv6-only and emit their AAAA record accordingly but IPv4 clients reach them through a siit routing. This plugin generates the associated A records for these clients automatically.

Syntax

siit {
    ipv6_prefix IPV6PREFIX
    eam IPV4 IPV6
}
  • ipv6_prefix specifies any local IPv6 prefix to use, instead of the well known prefix (64:ff9b::/96)
  • eam translates the ipv6 to the corresponding ipv4, it can be set multiple times

Examples

. {
    siit {
        ipv6_prefix 64:1337::/96
    }
}

Metrics

If monitoring is enabled (via the prometheus plugin) then the following metrics are exported:

  • coredns_siit_requests_translated_total{server} - counter of DNS requests translated

The server label is explained in the prometheus plugin documentation.

Bugs

  • Prefix matching in eam is not implemented yet.
  • DNSSEC support is not implemented yet. The problem is the same as DNS64. See: RFC 6147 Section 3

See Also

See RFC 6052 for more information on the SIIT mechanism and RFC 7757 about the explicit address mappings (eam) mechanism

Notes

This plugin is heavily based on dns64 plugin.

Documentation

Overview

Package siit implements a plugin that performs AAAA to A translation.

See: RFC 6052 (https://www.rfc-editor.org/info/rfc6052/) See: RFC 7757 (https://www.rfc-editor.org/info/rfc7757/)

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequestsTranslatedCount is the number of DNS requests translated by siit.
	RequestsTranslatedCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: pluginName,
		Name:      "requests_translated_total",
		Help:      "Counter of DNS requests translated by siit.",
	}, []string{"server"})
)

Functions

This section is empty.

Types

type SIIT

type SIIT struct {
	Next       plugin.Handler
	IPv6Prefix *net.IPNet
	Eam4       map[string]net.IP
	Upstream   UpstreamInt
}

SIIT performs SIIT.

func (*SIIT) DoSIIT

func (d *SIIT) DoSIIT(ctx context.Context, w dns.ResponseWriter, r *dns.Msg, origResponse *dns.Msg) (*dns.Msg, bool, error)

DoSIIT takes an (empty) response to an A question, issues the AAAA request, and synthesizes the answer. Returns the response message, or error on internal failure.

func (*SIIT) Name

func (d *SIIT) Name() string

Name implements the Handler interface.

func (*SIIT) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

func (*SIIT) Synthesize

func (d *SIIT) Synthesize(origReq, origResponse, resp *dns.Msg) (*dns.Msg, bool)

Synthesize merges the AAAA response and the records from the A response. The bool return reports whether at least one AAAA record was actually translated into a synthetic A record. false means the caller got back origResponse unchanged — nothing in the AAAA answer was mappable (no EAM entry, and the address wasn't in ipv6_prefix) — and this must not be counted as a translated request.

type UpstreamInt

type UpstreamInt interface {
	Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
}

UpstreamInt wraps the Upstream API for dependency injection during testing

Jump to

Keyboard shortcuts

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