Documentation ¶
Overview ¶
Package doh provides a package DNS-over-HTTPS (DoH) client implementation following RFC8484.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Query ¶
func Query(ctx context.Context, httpClient *http.Client, server string, dnsReq dns.Msg) (*dns.Msg, error)
Query performs a DNS query using a DoH server.
func SimpleQuery ¶
func SimpleQuery(ctx context.Context, httpClient *http.Client, server string, req *dj.Request) (*dj.Response, error)
SimpleQuery performs a DNS query using a DoH server using the dj (DNS JSON) format types to represent the request and response.
This is provided for backwards compatibility with the (original) DoH JSON API (and doh CLI tool), but it is generally recommended to use the newer RFC8484 implementation Query instead for new applications or more advanced use cases.
Types ¶
type KnownServer ¶
type KnownServer = string
KnownServer is a known DoH server URL.
var ( Google KnownServer = "https://dns.google/dns-query" Cloudflare KnownServer = "https://cloudflare-dns.com/dns-query" Quad9 KnownServer = "https://dns.quad9.net:5053/dns-query" )
Click to show internal directories.
Click to hide internal directories.