DnsRebindBlocking: Exclude authoritative responses.

This commit is contained in:
Yip Rui Fung
2023-12-09 13:14:46 +08:00
parent fe00b00e6d
commit 93e423cfe1

View File

@@ -46,7 +46,8 @@ namespace DnsRebindBlocking
public Task<DnsDatagram> PostProcessAsync(DnsDatagram request, IPEndPoint remoteEP, DnsTransportProtocol protocol, DnsDatagram response)
{
if (!Config.Enabled)
// Do not filter authoritative responses. Because in this case any rebinding is intentional.
if (!Config.Enabled || response.AuthoritativeAnswer)
return Task.FromResult(response);
var answers = response.Answer.Where(res => !IsFilteredRebind(res)).ToList();