dns

package
v0.0.0-...-64b0400 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package dns handles DNS operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTypeDescription

func GetTypeDescription(t Type) string

GetTypeDescription returns the description of a record type or "N/A" if not described.

func GetTypeName

func GetTypeName(t Type) string

GetTypeName returns the name for given type.

func GetTypeNames

func GetTypeNames() []string

GetTypeNames returns the list of all record type names.

func GetTypeURLs

func GetTypeURLs(t Type) []string

GetTypeURLs returns the url for a record type.

Types

type Client

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

Client represents a DNS client.

func NewClient

func NewClient(logger *zap.Logger, servers ...string) *Client

NewClient creates a new DNS client.

func (*Client) Query

func (c *Client) Query(ctx context.Context, rType Type, domain string) (string, error)

Query performs a DNS query for the given domain and returns the response.

type Type

type Type uint16

Type represents a DNS record type.

const (
	TypeA          Type = 1
	TypeNS         Type = 2
	TypeMD         Type = 3
	TypeMF         Type = 4
	TypeCNAME      Type = 5
	TypeSOA        Type = 6
	TypeMB         Type = 7
	TypeMG         Type = 8
	TypeMR         Type = 9
	TypeNULL       Type = 10
	TypePTR        Type = 12
	TypeHINFO      Type = 13
	TypeMINFO      Type = 14
	TypeMX         Type = 15
	TypeTXT        Type = 16
	TypeRP         Type = 17
	TypeAFSDB      Type = 18
	TypeX25        Type = 19
	TypeISDN       Type = 20
	TypeRT         Type = 21
	TypeNSAPPTR    Type = 23
	TypeSIG        Type = 24
	TypeKEY        Type = 25
	TypePX         Type = 26
	TypeGPOS       Type = 27
	TypeAAAA       Type = 28
	TypeLOC        Type = 29
	TypeNXT        Type = 30
	TypeEID        Type = 31
	TypeNIMLOC     Type = 32
	TypeSRV        Type = 33
	TypeATMA       Type = 34
	TypeNAPTR      Type = 35
	TypeKX         Type = 36
	TypeCERT       Type = 37
	TypeDNAME      Type = 39
	TypeOPT        Type = 41
	TypeAPL        Type = 42
	TypeDS         Type = 43
	TypeSSHFP      Type = 44
	TypeIPSECKEY   Type = 45
	TypeRRSIG      Type = 46
	TypeNSEC       Type = 47
	TypeDNSKEY     Type = 48
	TypeDHCID      Type = 49
	TypeNSEC3      Type = 50
	TypeNSEC3PARAM Type = 51
	TypeTLSA       Type = 52
	TypeSMIMEA     Type = 53
	TypeHIP        Type = 55
	TypeRKEY       Type = 57
	TypeTALINK     Type = 58
	TypeCDS        Type = 59
	TypeCDNSKEY    Type = 60
	TypeOPENPGPKEY Type = 61
	TypeCSYNC      Type = 62
	TypeZONEMD     Type = 63
	TypeSVCB       Type = 64
	TypeHTTPS      Type = 65
	TypeSPF        Type = 99
	TypeNID        Type = 104
	TypeL32        Type = 105
	TypeL64        Type = 106
	TypeLP         Type = 107
	TypeEUI48      Type = 108
	TypeEUI64      Type = 109
	TypeURI        Type = 256
	TypeCAA        Type = 257
	TypeAVC        Type = 258
	TypeAMTRELAY   Type = 260

	TypeTKEY Type = 249
	TypeTSIG Type = 250

	// valid Question.Qtype only.
	TypeIXFR  Type = 251
	TypeAXFR  Type = 252
	TypeMAILB Type = 253
	TypeMAILA Type = 254
	TypeANY   Type = 255

	TypeTA  Type = 32768
	TypeDLV Type = 32769
)

func GetType

func GetType(v string) (Type, error)

GetType returns the Type corresponding to the given string.

Jump to

Keyboard shortcuts

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