dns

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

README

DNS Probe

RFC: RFC1035


Timeout : 5sec 6.1.3.3 (5) https://tools.ietf.org/rfcmarkup?doc=1123#page-77

Documentation

Index

Constants

View Source
const Name = "dns"

Name of the probe

Variables

This section is empty.

Functions

func New

func New() probe.Probe

New returns a new Probe

Types

type Probe

type Probe struct {
	FQDN         string `json:"fqdn"`         // IP or Hostname
	RecordType   string `json:"recordtype" `  // Record Type to Lookup
	StrictAnswer bool   `json:"strictanswer"` // Attend uniquement la valeur
	NameServer   string `json:"nameserver" `  // Send Request to a specified Nameserver
}

Probe struct. Json and yaml descriptor are used for json output

func (*Probe) GenerateTStepName

func (p *Probe) GenerateTStepName() string

GenerateTStepName return a tstep name if non existent

func (Probe) GetName

func (Probe) GetName() string

Return Probe Name

func (*Probe) Initialize

func (p *Probe) Initialize(step probe.StepProbe) error

Initialize Probe struct data

func (*Probe) Run

func (p *Probe) Run(timeout time.Duration) (probeReturn []probe.ProbeReturn)

Start the probe request

type ProbeAnswer

type ProbeAnswer struct {
	Answer       []string        `json:"answer"`
	TTL          int             `json:"ttl"`
	ResponseTime float64         `json:"responsetime"` // Reference Time Unit = Second
	Class        string          `json:"class"`
	Priority     int             `json:"priority"`
	Weight       int             `json:"weight"`
	Port         int             `json:"port"`
	Target       string          `json:"target"`
	Proto        string          `json:"proto"`
	ProbeInfo    probe.ProbeInfo `json:"probeinfo"`
}

ProbeAnswer is the returned result after query

func LookupNS

func LookupNS(probe Probe) (*ProbeAnswer, error)

LookupNS returns the DNStask NS records for the given domain name.

Jump to

Keyboard shortcuts

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