Documentation
¶
Index ¶
Constants ¶
View Source
const ( RegularDns int64 = iota + 1 DnsOverUDP DnsOverTCP DnsOverTLS DnsOverHTTPS DnsOverHTTPSWithForcedH3 DnsOverQUIC )
Variables ¶
This section is empty.
Functions ¶
func DohJsonResponseToDnsMsg ¶
func DohJsonResponseToDnsMsg(dohResp DohJsonResponse) *dns.Msg
将 DoH JSON 响应转换为 dns.Msg
Types ¶
type DohJsonRequest ¶
type DohJsonRequest struct { Name string `json:"name"` Type uint16 `json:"type"` DO bool `json:"do,omitempty"` CD bool `json:"cd,omitempty"` }
DoH JSON schema using by Cloudflare and Google Cloudflare’s DNS over HTTPS endpoint also supports JSON format for querying DNS data. For lack of an agreed upon JSON schema for DNS over HTTPS in the Internet Engineering Task Force (IETF), Cloudflare has chosen to follow the same schema as Google’s DNS over HTTPS resolver.
type DohJsonResponse ¶
type DohJsonResponse struct { Status int `json:"Status"` TC bool `json:"TC"` RD bool `json:"RD"` RA bool `json:"RA"` AD bool `json:"AD"` CD bool `json:"CD"` Question []Question `json:"Question"` Answer []Answer `json:"Answer"` Authority []Answer `json:"Authority,omitempty"` Additional []interface{} `json:"Additional,omitempty"` EdnsClientSubnet string `json:"edns_client_subnet,omitempty"` Comment string `json:"Comment,omitempty"` }
Click to show internal directories.
Click to hide internal directories.