dnsclient

package
v0.0.0-...-dd779cd Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dnsclient contains logic to interact with different DoH providers ref: https://github.com/curl/curl/wiki/DNS-over-HTTPS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Lookup(name string, rType uint16) Response
}

Client is an interface all clients should conform to.

type CloudflareDNS

type CloudflareDNS struct {
	BaseURL string
}

CloudflareDNS is a Client instance resolving using Cloudflares DNS-over-HTTPS service

func NewCloudFlareDNS

func NewCloudFlareDNS() *CloudflareDNS

NewCloudFlareDNS starts a new Cloudflare DNS-over-HTTPS resolver Client

func (*CloudflareDNS) Lookup

func (c *CloudflareDNS) Lookup(name string, rType uint16) Response

Lookup performs a DNS lookup using Cloudflare

type GoogleDNS

type GoogleDNS struct {
	BaseURL string
}

GoogleDNS is a Client instance resolving using Googles DNS-over-HTTPS service

func NewGoogleDNS

func NewGoogleDNS() *GoogleDNS

NewGoogleDNS starts a new Google DNS-over-HTTPS resolver Client

func (*GoogleDNS) Lookup

func (c *GoogleDNS) Lookup(name string, rType uint16) Response

Lookup performs a DNS lookup using Google

type GoogleFrontDNS

type GoogleFrontDNS struct {
	BaseURL string
}

GoogleFrontDNS is a Client instance resolving using Googles DNS-over-HTTPS service, fronted using www.google.com

func NewGoogleFrontDNS

func NewGoogleFrontDNS() *GoogleFrontDNS

NewGoogleFrontDNS starts a new Google DNS-over-HTTPS resolver Client The Host header for this request is updated in the client itself

func (*GoogleFrontDNS) Lookup

func (c *GoogleFrontDNS) Lookup(name string, rType uint16) Response

Lookup performs a DNS lookup using Google

type Quad9DNS

type Quad9DNS struct {
	BaseURL string
}

Quad9DNS is a Client instance resolving using Quad9's DNS-over-HTTPS service

func NewQuad9DNS

func NewQuad9DNS() *Quad9DNS

NewQuad9DNS starts a new Quad9 DNS-over-HTTPS resolver Client

func (*Quad9DNS) Lookup

func (c *Quad9DNS) Lookup(name string, rType uint16) Response

Lookup performs a DNS lookup using Quad9

type RawDNS

type RawDNS struct {
}

RawDNS is a Client instance resolving using an operating systems configured DNS

func NewRawDNS

func NewRawDNS() *RawDNS

NewRawDNS starts a new client making use of traditional DNS

func (*RawDNS) Lookup

func (c *RawDNS) Lookup(name string, rType uint16) Response

Lookup performs a DNS lookup using UDP DNS

type Response

type Response struct {
	TTL    int
	Data   string
	Status string
}

Response is a resolvers response type

func Lookup

func Lookup(c Client, name string, rType uint16) Response

Lookup is used by the rest of the commands to resolve names

Jump to

Keyboard shortcuts

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