MCPcopy Index your code
hub / github.com/AdguardTeam/dnsproxy / includeToReserved

Method includeToReserved

proxy/upstreams.go:310–325  ·  view source on GitHub ↗

includeToReserved includes domains to reserved upstreams querying.

(dnsUpstream upstream.Upstream, domains []string)

Source from the content-addressed store, hash-verified

308
309// includeToReserved includes domains to reserved upstreams querying.
310func (p *configParser) includeToReserved(dnsUpstream upstream.Upstream, domains []string) {
311 for _, host := range domains {
312 if strings.HasPrefix(host, "*.") {
313 host = host[len("*."):]
314
315 p.subdomainsOnlyExclusions.Add(host)
316 p.logger.Debug("domain is added to exclusions list", "domain", host)
317
318 p.subdomainsOnlyUpstreams[host] = append(p.subdomainsOnlyUpstreams[host], dnsUpstream)
319 } else {
320 p.specifiedDomainUpstreams[host] = append(p.specifiedDomainUpstreams[host], dnsUpstream)
321 }
322
323 p.domainReservedUpstreams[host] = append(p.domainReservedUpstreams[host], dnsUpstream)
324 }
325}
326
327// validate returns an error if the upstreams aren't configured properly. c
328// considered valid if it contains at least a single default upstream. Empty c

Callers 1

specifyUpstreamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected