Merge: - dns rewrites: CNAME record didn't work

Close #1156

* commit '090f5498331844ad6d5a8dc975c1d0511b47565a':
  - dns rewrites: CNAME record didn't work
This commit is contained in:
Simon Zolin 2019-11-07 16:33:07 +03:00
commit 2f1e631c66
1 changed files with 1 additions and 0 deletions

View File

@ -432,6 +432,7 @@ func (s *Server) handleDNSRequest(p *proxy.Proxy, d *proxy.DNSContext) error {
if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 {
d.Req.Question[0] = originalQuestion
d.Res.Question[0] = originalQuestion
if len(d.Res.Answer) != 0 {
answer = append(answer, d.Res.Answer...) // host -> IP