File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import socket
66import struct
77import threading
8+ import argparse
89import time
910import random
1011import ssl
@@ -374,4 +375,26 @@ def run_stub(bind_ip="127.0.0.1", port=5353):
374375 time .sleep (3600 )
375376
376377if __name__ == "__main__" :
377- run_stub ("127.0.0.1" , 5353 )
378+ parser = argparse .ArgumentParser (
379+ description = "Simple iterative DNS stub resolver (UDP + TCP)"
380+ )
381+ parser .add_argument (
382+ "--bind" ,
383+ default = "127.0.0.1" ,
384+ help = "IP address to bind the DNS server (default: 127.0.0.1)"
385+ )
386+ parser .add_argument (
387+ "--port" ,
388+ type = int ,
389+ default = 5300 ,
390+ help = "Port to bind the DNS server (default: 5300)"
391+ )
392+
393+ args = parser .parse_args ()
394+
395+ print (
396+ "Starting DNS stub on %s:%d"
397+ % (args .bind , args .port )
398+ )
399+
400+ run_stub (args .bind , args .port )
You can’t perform that action at this time.
0 commit comments