dns

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWildcard

func CheckWildcard(ctx context.Context, domain string, timeout time.Duration, dnsServer string) (bool, error)

CheckWildcard probes the domain with two random subdomains. If both resolve the domain almost certainly uses wildcard DNS. Returns (isWildcard, error).

func ResolveDomain

func ResolveDomain(ctx context.Context, domain string, timeout time.Duration, dnsServer string, verbose bool) bool

ResolveDomain performs a single DNS lookup for the given domain using the specified server and timeout. It returns true if the domain resolves.

func ResolveDomainWithRetry

func ResolveDomainWithRetry(ctx context.Context, domain string, timeout time.Duration, dnsServer string, verbose bool, maxAttempts int) bool

ResolveDomainWithRetry calls ResolveDomain up to maxAttempts times, respecting ctx cancellation between attempts with a linear backoff delay.

func SimulateResolution

func SimulateResolution(domain string, hitRate int, verbose bool) bool

SimulateResolution returns a synthetic DNS result without performing any network I/O. Common subdomain prefixes resolve ~90% of the time; everything else uses the supplied hitRate (0-100).

Types

This section is empty.

Jump to

Keyboard shortcuts

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