dns

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

dns

Go Reference

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_RETRIES int = 2

The number of tries in case of error.

Functions

func Probe

func Probe(network, ip, port string, timeout time.Duration) (bool, error)

Probe checks whether DNS protocol is available on network on ip:port. This function do a simple query with "elmasy.com."/"A". network must be "tcp", "tcp-tls" or "udp".

func QueryA

func QueryA(name string) ([]net.IP, error)

QueryA returns net.IP structs of the answers. Returns nil in case of error. This function retries the query in case of error, up to MAX_RETRIES.

func QueryAAAA

func QueryAAAA(name string) ([]net.IP, error)

QueryAAAA returns net.IP structs of the answers. Returns nil in case of error. This function retries the query in case of error, up to MAX_RETRIES.

func QueryTXT

func QueryTXT(name string) ([]string, error)

QueryTXT returns the answer as a string slice. Returns nil in case of error. This function retries the query in case of error, up to MAX_RETRIES.

Types

type MX

type MX struct {
	Preference int    // Priority
	Exchange   string // Server's hostname
}

func QueryMX

func QueryMX(name string) ([]MX, error)

QueryMX returns MX structs of the answers. Returns nil in case of error. This function retries the query in case of error, up to MAX_RETRIES.

Jump to

Keyboard shortcuts

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