dnsx

package
v0.7.7-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dnsx abstracts DNS TXT lookups behind an interface so domain verification is testable with an injected fake resolver. The production implementation uses net.Resolver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TXTName

func TXTName(domain string) string

TXTName is the record name a domain must publish for verification. Agentry looks up a dedicated subdomain so the org's apex TXT records are untouched.

func VerifyTXT

func VerifyTXT(ctx context.Context, r Resolver, domain, token string) (bool, error)

VerifyTXT reports whether the verification token is present in any TXT record at TXTName(domain). Tokens are matched exactly (after trimming) and may be carried verbatim or as "agentry-domain-verification=<token>".

Types

type Resolver

type Resolver interface {
	LookupTXT(ctx context.Context, name string) ([]string, error)
}

Resolver looks up TXT records for a name. net.Resolver satisfies a superset of this; SystemResolver adapts it.

type SystemResolver

type SystemResolver struct{}

SystemResolver is the production Resolver backed by the OS resolver.

func NewSystemResolver

func NewSystemResolver() SystemResolver

NewSystemResolver returns a Resolver using net.DefaultResolver.

func (SystemResolver) LookupTXT

func (SystemResolver) LookupTXT(ctx context.Context, name string) ([]string, error)

LookupTXT implements Resolver.

Jump to

Keyboard shortcuts

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