dnsforward/ipset: add support for wildcard subdomain ipset matches
This matches dnsmasq behavior and the alternative is not really useful. See http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/forward.c;hb=f60fea1fb0a288011f57a25dfb653b8f6f8b46b9#l588
This commit is contained in:
@@ -158,6 +158,22 @@ func TestIpsetSubdomainOverride(t *testing.T) {
|
||||
assert.Equal(t, 1, len(b))
|
||||
}
|
||||
|
||||
func TestIpsetSubdomainWildcard(t *testing.T) {
|
||||
setup()
|
||||
|
||||
ctx.proxyCtx.Req = makeReqA("sub.host.com.")
|
||||
ctx.proxyCtx.Res = &dns.Msg{
|
||||
Answer: []dns.RR{
|
||||
makeA("sub.host.com.", net.IPv4(127, 0, 0, 1)),
|
||||
},
|
||||
}
|
||||
|
||||
doProcess(t)
|
||||
|
||||
assert.Equal(t, 1, b[Binding{"sub.host.com", "name", "127.0.0.1"}])
|
||||
assert.Equal(t, 1, len(b))
|
||||
}
|
||||
|
||||
func TestIpsetCnameThirdParty(t *testing.T) {
|
||||
setup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user