doh

package
v0.0.0-...-61ee39e Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 8 Imported by: 0

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"
)

Jump to

Keyboard shortcuts

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