google

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const DEFAULT_DNS_SERVER = "https://dns.google.com/resolve"

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSQuestion

type DNSQuestion struct {
	Name string `json:"name,omitempty"`
	Type int32  `json:"type,omitempty"`
}

type DNSRR

type DNSRR struct {
	Name string `json:"name,omitempty"`
	Type int32  `json:"type,omitempty"`
	TTL  int32  `json:"TTL,omitempty"`
	Data string `json:"data,omitempty"`
}

type RespRepr

type RespRepr struct {
	Status             int32         `json:"Status,omitempty"`
	TC                 bool          `json:"TC,omitempty"`
	RD                 bool          `json:"RD,omitempty"`
	RA                 bool          `json:"RA,omitempty"`
	AD                 bool          `json:"AD,omitempty"`
	CD                 bool          `json:"CD,omitempty"`
	Question           []DNSQuestion `json:"Question,omitempty"`
	Answer             []DNSRR       `json:"Answer,omitempty"`
	Authority          []DNSRR       `json:"Authority,omitempty"`
	Additional         []DNSRR       `json:"Additional,omitempty"`
	Edns_client_subnet string        `json:"edns_client_subnet,omitempty"`
	Comment            string        `json:"Comment,omitempty"`
}

--- partially copied from https://github.com/wrouesnel/dns-over-https-proxy/blob/master/dns-over-https-proxy.go Rough translation of the Google DNS over HTTP API

func Query

func Query(rt http.RoundTripper, qtype uint16, name string, ecs ...string) (*RespRepr, error)

Performs a DNS over HTTPS query qtype: The resource records type to be requested, such as dns.TypeTA name: Domian name to resolve. Example: `twitter.com`, `twitter.com.` ecs(optional): edns client subnet, `0.0.0.0/0` as default if empty. Example: `0.0.0.0/0`

Jump to

Keyboard shortcuts

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