resolve

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resolve is used to handle resolving records It also handles wildcard subdomains and rotating resolvers.

Index

Constants

This section is empty.

Variables

View Source
var DefaultResolvers = []string{
	"1.1.1.1:53",
	"1.0.0.1:53",
}

DefaultResolvers contains the default list of resolvers known to be good. Cloudflare only — fast and reliable; system resolvers are usually slow.

Functions

This section is empty.

Types

type HostEntry

type HostEntry struct {
	Domain              string
	Host                string
	Source              string
	WildcardCertificate bool
}

HostEntry defines a host with the source

type ResolutionPool

type ResolutionPool struct {
	*Resolver
	Tasks   chan HostEntry
	Results chan Result
	// contains filtered or unexported fields
}

ResolutionPool is a pool of resolvers created for resolving subdomains for a given host.

func (*ResolutionPool) InitWildcards

func (r *ResolutionPool) InitWildcards(domain string) error

InitWildcards inits the wildcard ips array

type Resolver

type Resolver struct {
	DNSClient *dnsx.DNSX
}

Resolver is a struct for resolving DNS names

func New

func New() *Resolver

New creates a new resolver struct

func (*Resolver) NewResolutionPool

func (r *Resolver) NewResolutionPool(workers int, removeWildcard bool) *ResolutionPool

NewResolutionPool creates a pool of resolvers for resolving subdomains of a given domain

type Result

type Result struct {
	Type                ResultType
	Host                string
	IP                  string
	Error               error
	Source              string
	WildcardCertificate bool
}

Result contains the result for a host resolution

type ResultType

type ResultType int

ResultType is the type of result found

const (
	Subdomain ResultType = iota
	Error
)

Types of data result can return

Jump to

Keyboard shortcuts

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