client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Servers []string
	Timeout time.Duration
}

Client is a DNS client

func New

func New(options ...*Options) *Client

New creates a new DNS client

func (*Client) LookUp

func (c *Client) LookUp(domain string, options ...*LookUpOptions) ([]string, error)

LookUp looks up a domain name and returns a list of IP addresses

type LookUpOptions

type LookUpOptions struct {
	Typ int
}

LookUpOptions is a set of options for LookUp

type Options

type Options struct {
	// Servers is a list of DNS servers to use.
	// Support
	//   1. PLAIN DNS						- 8.8.8.8:53 or udp://dns.adguard.com for plain DNS;
	//	 2. PLAIN DNS-over-TCP 	- tcp://8.8.8.8:53 for plain DNS-over-TCP;
	// 	 3. DNS-over-TLS 				- tls://1.1.1.1 for DNS-over-TLS;
	//   4. DNS-over-HTTPS			- https://dns.adguard.com/dns-query for DNS-over-HTTPS;
	//   5. DNSCRYPT 						- sdns://... for DNS stamp, see https://dnscrypt.info/stamps-specifications.
	Servers []string

	// Timeout is the maximum duration to wait for a response from a server.
	// default: 5 seconds
	Timeout time.Duration
}

Options is a set of options for Client

Jump to

Keyboard shortcuts

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