Small changes based on review comments

This commit is contained in:
Patrick Pacher
2020-04-20 08:25:34 +02:00
parent 9deb1623d6
commit 42ccb3e39a
3 changed files with 14 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package nameserver
import (
"context"
"errors"
"fmt"
"net"
"strings"
@@ -247,7 +248,7 @@ func handleRequest(ctx context.Context, w dns.ResponseWriter, query *dns.Msg) er
// TODO: analyze nxdomain requests, malware could be trying DGA-domains
tracer.Warningf("nameserver: %s requested %s%s: %s", conn.Process(), q.FQDN, q.QType, err)
if _, ok := err.(*resolver.BlockedUpstreamError); ok {
if errors.Is(err, &resolver.BlockedUpstreamError{}) {
conn.Block(err.Error())
} else {
conn.Failed("failed to resolve: " + err.Error())