qlib

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: BSD-2-Clause Imports: 7 Imported by: 3

README

qlib

This is a library for performing DNS queries. Its API is similar to the command-line tool q by Miek Gieben (and in fact qlib is a fork of q), but its API is exposed as a Go library instead of a command-line tool.

Original miekg/exdns README

Build Status BSD 2-clause license

Examples made with Go DNS

This repository has a bunch of example programs that are made with the https://github.com/miekg/dns Go package.

Currently they include:

  • as112: an AS112 black hole server
  • chaos: show DNS server identity
  • check-soa: check the SOA record of zones for all nameservers
  • q: dig-like query tool
  • reflect: reflection nameserver

Documentation

Overview

Q is a small utility which acts and behaves like 'dig' from BIND. It is meant to stay lean and mean, while having a bunch of handy features, like -check which checks if a packet is correctly signed (without checking the chain of trust). When using -check a comment is printed:

;+ Secure signature, miek.nl. RRSIG(SOA) validates (DNSKEY miek.nl./4155/net)

which says the SOA has a valid RRSIG and it validated with the DNSKEY of miek.nl, which has key id 4155 and is retrieved from the server. Other values are 'disk'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Dnskey       *dns.DNSKEY
	Short        bool
	Dnssec       bool
	Query        bool
	Check        bool
	Six          bool
	Four         bool
	Anchor       string
	Tsig         string
	Port         int
	Laddr        string
	Aa           bool
	Ad           bool
	Cd           bool
	Rd           bool
	Fallback     bool
	Tcp          bool
	TimeoutDial  time.Duration
	TimeoutRead  time.Duration
	TimeoutWrite time.Duration
	Nsid         bool
	Client       string
	Opcode       string
	Rcode        string
}

func DefaultParams

func DefaultParams() *Params

func (*Params) Do

func (p *Params) Do(args []string) (*Result, error)

type Result

type Result struct {
	QueryMsg        *dns.Msg
	ResponseMsg     *dns.Msg
	Rtt             time.Duration
	Nameserver      string
	Net             string
	XfrEnvelope     chan *dns.Envelope
	FallbackBufSize bool
	FallbackTcp     bool
}

TODO: handle multiple qnames

Directories

Path Synopsis
cmd
q

Jump to

Keyboard shortcuts

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