def resolve(self, request, handler): if request.q.qname in self.blacklist: # print(request.q.qname) answer = RR(rdata=A(self.host)) answer.set_rname(self.answer) reply = request.reply() reply.add_answer(answer) # print(reply) # print('-' * 200) return reply else: return ProxyResolver.resolve(self, request, handler)
def resolve(self, request, handler): print(request.q.qname) if request.q.qname in self.blacklist: answer = RR(rdata=A(self.host)) answer.set_rname(self.answer) reply = request.reply() reply.add_answer(answer) print(reply) print("-" * 200) return reply return ProxyResolver.resolve(self, request, handler)