Fix forwarding of subdomains

This commit is contained in:
Frank Denis 2018-01-17 16:16:22 +01:00
parent f35357ef88
commit 9f8bce28a4
2 changed files with 1 additions and 2 deletions

View File

@ -10,4 +10,3 @@
## be set to that file name in the main configuration file.
example.com 9.9.9.9,8.8.8.8

View File

@ -84,7 +84,7 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
if candidateLen > questionLen {
continue
}
if question[questionLen-candidateLen:] == candidate.domain && (candidateLen == questionLen || (question[questionLen-candidateLen] == '.')) {
if question[questionLen-candidateLen:] == candidate.domain && (candidateLen == questionLen || (question[questionLen-candidateLen-1] == '.')) {
servers = candidate.servers
break
}