dnsresolver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package dnsresolver provides automatic DNS failover for vmflow outbound connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver tries the host operating system policy first and then the built-in domestic fallback resolvers. Temporarily failed sources are retried after a short cooldown, so normal system DNS automatically becomes primary again.

func New

func New() *Resolver

New builds vmflow's zero-configuration DNS resolver.

func (*Resolver) DialContext

func (resolver *Resolver) DialContext(ctx context.Context, dialer *net.Dialer, network, address string) (net.Conn, error)

DialContext resolves the host with automatic failover, then dials the returned addresses within the dialer's overall timeout/deadline.

func (*Resolver) LookupHost

func (resolver *Resolver) LookupHost(ctx context.Context, host string) ([]string, error)

LookupHost resolves host and returns textual IP addresses.

func (*Resolver) LookupIPAddr

func (resolver *Resolver) LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error)

LookupIPAddr resolves host using automatic failover.

func (*Resolver) LookupTXT

func (resolver *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error)

LookupTXT resolves TXT records using automatic failover.

func (*Resolver) ResolveTCPAddr

func (resolver *Resolver) ResolveTCPAddr(ctx context.Context, network, address string) (*net.TCPAddr, error)

ResolveTCPAddr resolves a numeric-port TCP endpoint with automatic failover.

func (*Resolver) ResolveUDPAddr

func (resolver *Resolver) ResolveUDPAddr(ctx context.Context, network, address string) (*net.UDPAddr, error)

ResolveUDPAddr resolves a numeric-port UDP endpoint with automatic failover.

Jump to

Keyboard shortcuts

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