{"id":24761010,"url":"https://github.com/ziozzang/pydnsproxy","last_synced_at":"2025-06-12T18:32:37.843Z","repository":{"id":22851979,"uuid":"26199408","full_name":"ziozzang/PyDNSProxy","owner":"ziozzang","description":"DNS Proxy + SNI/HTTP Proxy + Very Basic Authenticate + Very Simple Configuration with Python","archived":false,"fork":false,"pushed_at":"2021-09-04T16:50:20.000Z","size":20,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T11:47:02.386Z","etag":null,"topics":["dns","dns-proxy-sni","docker","http-proxy","python","sniproxy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziozzang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-05T02:35:50.000Z","updated_at":"2022-11-03T10:26:26.000Z","dependencies_parsed_at":"2022-08-21T15:30:39.256Z","dependency_job_id":null,"html_url":"https://github.com/ziozzang/PyDNSProxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziozzang/PyDNSProxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FPyDNSProxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FPyDNSProxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FPyDNSProxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FPyDNSProxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziozzang","download_url":"https://codeload.github.com/ziozzang/PyDNSProxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FPyDNSProxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519255,"owners_count":22870327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","dns-proxy-sni","docker","http-proxy","python","sniproxy"],"created_at":"2025-01-28T18:20:35.399Z","updated_at":"2025-06-12T18:32:37.807Z","avatar_url":"https://github.com/ziozzang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PyDNSProxy\n==========\n\nPyDNSProxy Configuration.\n\nAuthor\n======\n\nJioh L. Jung (ziozzang@gmail.com)\n\nLicense\n=======\n\nThis code is under License of BSD.\n\nFunctions\n=========\n\nDNS Proxy + SNI/HTTP Proxy + Very Basic Authenticate\n\nRunning\n===========\n\nThis source is working with Python 3.x + AsyncIO. you have to run in \\*NIX include Linux as root permission.\n\n* Use Docker Hub's pre-built version\n\n```\ndocker run -it --rm \\\n  -p 53:53/udp -p 443:443 -p 80:80 \\\n  -v `pwd`/dns.conf:/opt/dns.conf \\\n  -e \"AUTH_LIST=10.2.3.4,10.9.8.7\" \\\n  -e \"AUTH_BLOCK=10.3.4.0/24,192.4.5.0/24\" \\\n  -e \"PASSPHASE=open.sesami\" \\\n  -e \"EXT_IP=1.2.3.4\" -e \"SELF_IP=5.6.7.8\" \\\n  ziozzang/pydnsproxy\n```\n\n* Use own build\nif you want to run with Docker, build and launch.\n\n```\ndocker build -t pydnsproxy .\ndocker run -it --rm \\\n  -p 53:53/udp -p 443:443 -p 80:80 \\\n  -v `pwd`/dns.conf:/opt/dns.conf \\\n  -e \"AUTH_LIST=10.2.3.4,10.9.8.7\" \\\n  -e \"AUTH_BLOCK=10.3.4.0/24,192.4.5.0/24\" \\\n  -e \"PASSPHASE=open.sesami\" \\\n  -e \"EXT_IP=1.2.3.4\" -e \"SELF_IP=5.6.7.8\" \\\n  pydnsproxy\n#Volume mount and Port Binding.\n# you can set upstream DNS server on specific docker, use \"--dns=\" option.\n```\n\nConfiguration\n=============\n\non source code, there's 3 kind of configuration.\n\n1. Authentication is on source code as IP list. if IP is in list or block, DNS and SNI proxy working. else, ith doesn't reply.\n```\nauth_list = [\"10.2.3.4\", \"10.3.4.5\"]  # per IP Auth.\nauth_block = [\"10.1.0.0/16\", \"10.98.76.0/24\"] # Block by\n```\n\n2. or Passphase for SNIProxy Open. dns query of this Record, the gate will be open!\n```\npassphase = \"open.the.gate.sesami\"\n```\n\n3. Check the domain is really exist.\n```\nfilter_exist_dns = True\n```\n\n4. if you want to allow any IP, set environment parameter \"ALLOW_ANY\" \n\n5. if you want to run only DNS server (no sniproxy), set environment parameter \"ONLY_DNS_SERVER\"\n    * you can use go version SNIProxy: https://github.com/ziozzang/SimpleSNIProxy\n\non dns.conf file, you can control dns record what to reply fake one. see dns.conf file.\n\nMatching Rules\n==============\n\n1. Matchings are sequancial.\n    * Block(No Result Returned) -\u003e Exactly Match(Exactly Same Domain only) -\u003e Forward Match(Ask upper DNS) -\u003e Zone Match -\u003e RegEx Match/Allow -\u003e RegEx Match/Block\n\n2. if one rule matched, ignored remains.\n\n3. There's 3 kinds of match type. partial match(match zone), exact match and regular expression match.\n    * Block : Partial Match\n    * Exact Match: Exact Match\n    * Forward : Partial Match\n    * Zone : Partial Match\n    * RegEx/Allow : RegEx.\n    * RegEx/Block : RegEx.\n\nSpecial Thanks\n==============\n\n* Basic SNI Proxy code from Phus Lu \u003cphus.lu@gmail.com\u003e https://github.com/phuslu/sniproxy/\n* DNSProxy code from Crypt0s's FakeDNS. https://github.com/Crypt0s/FakeDns\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fpydnsproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziozzang%2Fpydnsproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fpydnsproxy/lists"}