Skip to content

Commit

Permalink
fix hosts (#240)
Browse files Browse the repository at this point in the history
When hosts exist but query type do not match, an empty result should be returned.
  • Loading branch information
wzv5 committed Aug 17, 2020
1 parent 5542834 commit 29cd667
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/outbound/clients/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ func (c *LocalClient) exchangeFromHosts() bool {
}
}

if (len(ipv4List) > 0 || len(ipv6List) > 0) &&
(c.questionMessage.Question[0].Qtype == dns.TypeA || c.questionMessage.Question[0].Qtype == dns.TypeAAAA) {
c.setLocalResponseMessage(nil)
return true
}

return false
}

Expand Down

0 comments on commit 29cd667

Please sign in to comment.