From aa2e5500e72864727a0dcd196f37e84931cfa30a Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Tue, 11 Sep 2018 17:57:20 +0300 Subject: [PATCH] coredns plugin -- do not filter out non-FQDN's -- otherwise it breaks serving /etc/hosts --- coredns_plugin/coredns_plugin.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/coredns_plugin/coredns_plugin.go b/coredns_plugin/coredns_plugin.go index b06910ab..a61e1134 100644 --- a/coredns_plugin/coredns_plugin.go +++ b/coredns_plugin/coredns_plugin.go @@ -370,14 +370,6 @@ func (d *Plugin) serveDNSInternal(ctx context.Context, w dns.ResponseWriter, r * } for _, question := range r.Question { host := strings.ToLower(strings.TrimSuffix(question.Name, ".")) - // if input is empty host, filter it out right away - if index := strings.IndexByte(host, byte('.')); index == -1 { - rcode, err := writeNXdomain(ctx, w, r) - if err != nil { - return rcode, err, dnsfilter.Result{} - } - return rcode, err, dnsfilter.Result{Reason: dnsfilter.FilteredInvalid} - } // is it a safesearch domain? if val, ok := d.d.SafeSearchDomain(host); ok { rcode, err := d.replaceHostWithValAndReply(ctx, w, r, host, val, question)