includeToReserved includes domains to reserved upstreams querying.
(dnsUpstream upstream.Upstream, domains []string)
| 308 | |
| 309 | // includeToReserved includes domains to reserved upstreams querying. |
| 310 | func (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 |