From 5a3de2a276c40b795cdc916d4e03c1a458ba313b Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Mon, 22 Jul 2019 12:33:58 +0300 Subject: [PATCH] * refactor --- dnsforward/dnsforward.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dnsforward/dnsforward.go b/dnsforward/dnsforward.go index e7cef514..7cd88eda 100644 --- a/dnsforward/dnsforward.go +++ b/dnsforward/dnsforward.go @@ -531,16 +531,7 @@ func (s *Server) genDNSFilterMessage(d *proxy.DNSContext, result *dnsfilter.Resu return s.genBlockedHost(m, s.conf.ParentalBlockHost, d) default: if result.IP != nil { - if m.Question[0].Qtype == dns.TypeA { - return s.genARecord(m, result.IP) - } else if m.Question[0].Qtype == dns.TypeAAAA { - return s.genAAAARecord(m, result.IP) - } - - // empty response - resp := dns.Msg{} - resp.SetReply(m) - return &resp + return s.genResponseWithIP(m, result.IP) } if s.conf.BlockingMode == "null_ip" {