18 lines
585 B
Python
Executable File
18 lines
585 B
Python
Executable File
#!/bin/python
|
|
from dnslib import server
|
|
import dnslib
|
|
from dns_over_https import SecureDNS
|
|
print("DoH Proxy resolver - <Written by Caleb Fontenot>")
|
|
|
|
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() |