all: sync with master
This commit is contained in:
committed by
Eugene Burkov
parent
39e22ada96
commit
ce2ee143d2
@@ -281,6 +281,10 @@ type ServerConfig struct {
|
||||
|
||||
// ServePlainDNS defines if plain DNS is allowed for incoming requests.
|
||||
ServePlainDNS bool
|
||||
|
||||
// PendingRequestsEnabled defines if duplicate requests should be forwarded
|
||||
// to upstreams along with the original one.
|
||||
PendingRequestsEnabled bool
|
||||
}
|
||||
|
||||
// UpstreamMode is a enumeration of upstream mode representations. See
|
||||
@@ -324,6 +328,9 @@ func (s *Server) newProxyConfig() (conf *proxy.Config, err error) {
|
||||
UsePrivateRDNS: srvConf.UsePrivateRDNS,
|
||||
PrivateSubnets: s.privateNets,
|
||||
MessageConstructor: s,
|
||||
PendingRequests: &proxy.PendingRequestsConfig{
|
||||
Enabled: srvConf.PendingRequestsEnabled,
|
||||
},
|
||||
}
|
||||
|
||||
if srvConf.EDNSClientSubnet.UseCustom {
|
||||
|
||||
@@ -261,6 +261,16 @@ type dnsConfig struct {
|
||||
// HostsFileEnabled defines whether to use information from the system hosts
|
||||
// file to resolve queries.
|
||||
HostsFileEnabled bool `yaml:"hostsfile_enabled"`
|
||||
|
||||
// PendingRequests configures duplicate requests policy.
|
||||
PendingRequests *pendingRequests `yaml:"pending_requests"`
|
||||
}
|
||||
|
||||
// pendingRequests is a block with pending requests configuration.
|
||||
type pendingRequests struct {
|
||||
// Enabled controls if duplicate requests should be sent to the upstreams
|
||||
// along with the original one.
|
||||
Enabled bool `yaml:"enabled"`
|
||||
}
|
||||
|
||||
type tlsConfigSettings struct {
|
||||
@@ -380,6 +390,9 @@ var config = &configuration{
|
||||
UsePrivateRDNS: true,
|
||||
ServePlainDNS: true,
|
||||
HostsFileEnabled: true,
|
||||
PendingRequests: &pendingRequests{
|
||||
Enabled: true,
|
||||
},
|
||||
},
|
||||
TLS: tlsConfigSettings{
|
||||
PortHTTPS: defaultPortHTTPS,
|
||||
|
||||
@@ -272,6 +272,7 @@ func newServerConfig(
|
||||
ServeHTTP3: dnsConf.ServeHTTP3,
|
||||
UseHTTP3Upstreams: dnsConf.UseHTTP3Upstreams,
|
||||
ServePlainDNS: dnsConf.ServePlainDNS,
|
||||
PendingRequestsEnabled: dnsConf.PendingRequests.Enabled,
|
||||
}
|
||||
|
||||
var initialAddresses []netip.Addr
|
||||
|
||||
@@ -64,7 +64,7 @@ type Entry struct {
|
||||
Domain string
|
||||
|
||||
// UpstreamStats contains the DNS query statistics for both the upstream and
|
||||
// fallback DNS servers.
|
||||
// fallback DNS servers. Don't modify items in the slice.
|
||||
UpstreamStats []*proxy.UpstreamStatistics
|
||||
|
||||
// Result is the result of processing the request.
|
||||
|
||||
Reference in New Issue
Block a user