Skip to content

Instantly share code, notes, and snippets.

@Ardumine
Ardumine / redirecter.py
Created August 18, 2024 11:26
Python DNS server to redirect all the requests to a IP
import socket
#From https://stackoverflow.com/questions/41723507/create-a-dns-server-and-redirect-all-request-to-my-site
#Translated and made it work with newer python
#Run as admin: sudo python3 redirecter.py
#You can test the server with the host command in linux: host google.com 127.0.0.1
class DNSQuery:
def __init__(self, data):