From fdc1bc834162b64c0d241d0f4ce3fe8402c0895b Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Mon, 10 Jan 2022 18:05:05 -0600 Subject: [PATCH] Init --- main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 main.py diff --git a/main.py b/main.py new file mode 100755 index 0000000..a84055d --- /dev/null +++ b/main.py @@ -0,0 +1,18 @@ +#!/bin/python +from dnslib import server +import dnslib +from dns_over_https import SecureDNS +print("DoH Proxy resolver - ") + +class DoHProxy: + def resolve(self,request,handler): + reply = request.reply() + reply.add_answer(dnslib.dns.RR.fromZone("abc.def. 60 A 1.2.3.4")) + return reply + +#Setup DNS server, this will listen for incoming DNS packets +resolver = DoHProxy() +logger = server.DNSLogger(prefix=True) +server = server.DNSServer(resolver,port=53,address="localhost",logger=logger, tcp=False) +#server.start_thread() +server.start() \ No newline at end of file