dnsforward -- trim dot in the end of hostname, dnsfilter does not expect it there

This commit is contained in:
Eugene Bujak 2018-11-30 13:17:34 +03:00
parent 9089122b56
commit a6e0a17454
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"log"
"net"
"reflect"
"strings"
"sync"
"github.com/AdguardTeam/AdGuardHome/dnsfilter"
@ -406,7 +407,7 @@ func (s *Server) handlePacket(p []byte, addr net.Addr, conn *net.UDPConn) {
return
}
}
host := msg.Question[0].Name
host := strings.TrimSuffix(msg.Question[0].Name, ".")
res, err := s.dnsFilter.CheckHost(host)
if err != nil {
log.Printf("dnsfilter failed to check host '%s': %s", host, err)