wildcard

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWildcardProbeCount = 3

Variables

This section is empty.

Functions

func RegistrableRoot

func RegistrableRoot(host string) (string, bool)

RegistrableRoot returns the registrable root for the provided host. The input is normalized first by lowercasing it, trimming a leading *., and removing any trailing dot. IP literals and invalid hosts are rejected.

Types

type LookupFunc

type LookupFunc func(host string) ([]string, error)

LookupFunc resolves a host and returns the address answers used for wildcard matching.

type Resolver

type Resolver struct {
	Domains *sliceutil.SyncSlice[string]
	// contains filtered or unexported fields
}

Resolver represents a wildcard resolver extracted from shuffledns.

func NewResolver

func NewResolver(domains []string, lookup LookupFunc) *Resolver

NewResolver initializes and creates a new resolver to find wildcards.

func NewResolverWithDomains

func NewResolverWithDomains(domains *sliceutil.SyncSlice[string], lookup LookupFunc) *Resolver

NewResolverWithDomains initializes a resolver with a pre-built domain slice.

func (*Resolver) GetAllWildcardIPs

func (w *Resolver) GetAllWildcardIPs() map[string]struct{}

func (*Resolver) LookupHost

func (w *Resolver) LookupHost(host string, knownIPs []string) (bool, map[string]struct{})

LookupHost returns wildcard IP addresses of a wildcard if it's a wildcard. To determine this, we split the target host by dots, generate wildcard permutations for each level of the matched domain, and probe those levels. If any of the host IPs overlap with wildcard answers collected for those levels, the host is treated as wildcard-backed.

func (*Resolver) SetProbeCount

func (w *Resolver) SetProbeCount(count int)

SetProbeCount sets the number of probes to use for wildcard detection. Higher values improve detection of wildcards using DNS round-robin.

Jump to

Keyboard shortcuts

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