dns

package
v0.0.0-...-05e2a6c Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootServers []string

RootServers is a slice of root servers.

Functions

func GetCachedDNSServer

func GetCachedDNSServer(log *zap.Logger) string

GetCachedDNSServer is used to get the cache DNS server.

func NextRootServer

func NextRootServer() string

NextRootServer returns the next root server along, looping back around.

Types

type Record

type Record struct {
	// Type is used to define the type of the record.
	Type string `json:"type"`

	// TTL is the time to live of the DNS record.
	TTL uint32 `json:"ttl"`

	// Preference is used for MX records.
	Preference *uint16 `json:"priority,omitempty"`

	// Name is used to define the name of the DNS record.
	Name string `json:"name"`

	// Value is used to define the value of the DNS record.
	Value json.RawMessage `json:"value"`
	// contains filtered or unexported fields
}

type RecordType

type RecordType []Server

func LookupRDNS

func LookupRDNS(log *zap.Logger, ip net.IP, dnsServer string) (RecordType, error)

func (RecordType) String

func (rt RecordType) String() string

type Response

type Response map[string]RecordType

func Lookup

func Lookup(log *zap.Logger, dnsServer, recordType, hostname string, fullTrace bool) (Response, error)

func (Response) String

func (r Response) String() string

type Server

type Server struct {
	Server  string   `json:"server"`
	Records []Record `json:"records"`
}

func (Server) String

func (srv Server) String() string

Jump to

Keyboard shortcuts

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