dns

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRecords

func LoadRecords() map[string][]DNSRecord

LoadRecords loads DNS records from environment variables

func ResolveServiceIP

func ResolveServiceIP(serviceName string) (string, error)

ResolveServiceIP attempts to resolve Docker service name to IP

Types

type DNSRecord

type DNSRecord struct {
	Domain     string
	Value      string
	TTL        uint32
	RecordType RecordType
	IsService  bool
	Priority   uint16 // For MX records
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(records map[string][]DNSRecord) *Handler

func (*Handler) ServeDNS

func (h *Handler) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

type RecordType

type RecordType string
const (
	ARecord     RecordType = "A"
	CNAMERecord RecordType = "CNAME"
	MXRecord    RecordType = "MX"
	TXTRecord   RecordType = "TXT"

	// Record separator
	RecordSeparator = "|"
)

Jump to

Keyboard shortcuts

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