Skip to content

Commit 29cd667

Browse files
authored
fix hosts (#240)
When hosts exist but query type do not match, an empty result should be returned.
1 parent 5542834 commit 29cd667

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/outbound/clients/local.go

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ func (c *LocalClient) exchangeFromHosts() bool {
7777
}
7878
}
7979

80+
if (len(ipv4List) > 0 || len(ipv6List) > 0) &&
81+
(c.questionMessage.Question[0].Qtype == dns.TypeA || c.questionMessage.Question[0].Qtype == dns.TypeAAAA) {
82+
c.setLocalResponseMessage(nil)
83+
return true
84+
}
85+
8086
return false
8187
}
8288

0 commit comments

Comments
 (0)