Help us shape the future of Go! Take the 2026 Go Developer Survey

dns

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLabelLength = 63

MaxLabelLength is the maximum length for a name that can be used in DNS.

Variables

View Source
var InvalidNameRe = regexp.MustCompile(`[^A-Za-z0-9\\-]+`)

InvalidNameRe is a regex that matches characters which can not be included in a DNS name.

Functions

func IsValidLabel

func IsValidLabel(name string) bool

IsValidLabel returns true if the string given is a valid DNS label (RFC 1123). Note: the only difference between RFC 1035 and RFC 1123 labels is that in RFC 1123 labels can begin with a number.

func ValidateLabel

func ValidateLabel(name string) error

ValidateLabel is similar to IsValidLabel except it returns an error instead of false when name is not a valid DNS label. The error will contain reference to what constitutes a valid DNS label.

Types

type RecursorStrategy

type RecursorStrategy string
const (
	RecursorStrategySequential RecursorStrategy = "sequential"
	RecursorStrategyRandom     RecursorStrategy = "random"
)

func (RecursorStrategy) Indexes

func (s RecursorStrategy) Indexes(max int) []int

Jump to

Keyboard shortcuts

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