{"id":21517812,"url":"https://github.com/csg2008/dnsproxy","last_synced_at":"2025-03-17T16:40:39.796Z","repository":{"id":193002579,"uuid":"109151769","full_name":"csg2008/dnsproxy","owner":"csg2008","description":"A simple dns proxy server with in memory cache.","archived":false,"fork":false,"pushed_at":"2021-04-13T02:15:04.000Z","size":33,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-09-06T09:59:03.031Z","etag":null,"topics":["dns","dnsproxy"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csg2008.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,"governance":null}},"created_at":"2017-11-01T15:55:59.000Z","updated_at":"2023-09-06T09:59:17.558Z","dependencies_parsed_at":"2023-09-06T10:12:19.094Z","dependency_job_id":null,"html_url":"https://github.com/csg2008/dnsproxy","commit_stats":null,"previous_names":["csg2008/dnsproxy"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csg2008%2Fdnsproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csg2008%2Fdnsproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csg2008%2Fdnsproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csg2008%2Fdnsproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csg2008","download_url":"https://codeload.github.com/csg2008/dnsproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244070630,"owners_count":20393246,"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","dnsproxy"],"created_at":"2024-11-24T00:45:28.273Z","updated_at":"2025-03-17T16:40:39.774Z","avatar_url":"https://github.com/csg2008.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dns proxy\nA simple dns proxy server with in memory cache.\n\n# 功能说明：  \n1、支持并发向多台远程 DNS 服务器查询来解决 DNS 稳定性问题  \n2、支持基于内存的查询结果缓存来提高查询性能，并支持调整缓存时间  \n3、支持不同的域名转发到不同的后端服务器组，满足特定的业务场景需求  \n4、支持域名与查询结果映射，可以用于内部非公开的域名解析服务，提升安全性  \n\n# 配置文件内容说明：\n```json\n{\n    \"bind\":{             // Socket 监听配置\n        \"udp\":  \":53\",   // 监听的 UDP 端口\n        \"http\": \":8080\"  // 监听的 HTTP 端口\n    },\n    \"forwarders\" : {     // 远程 DNS 服务器组，用于不同域名转发到不同的服务器组\n        \"normal\":[\"223.5.5.5:53\", \"223.6.6.6:53\", \"119.29.29.29:53\", \"182.254.116.116:53\", \"101.226.4.6:53\", \"114.114.114.114:53\", \"114.114.115.115:53\", \"202.67.240.222:53\", \"203.80.96.10:53\", \"202.45.84.58:53\"],\n        \"gfw\":[\"74.82.42.42:53\", \"107.150.40.234:53\", \"162.211.64.20:53\", \"50.116.23.211:53\", \"50.116.40.226:53\", \"37.235.1.174:53\", \"37.235.1.177:53\", \"8.8.8.8:53\", \"8.8.4.4:53\", \"208.67.222.222:53\", \"208.67.220.220:53\", \"8.26.56.26:53\", \"84.200.69.80:53\"]\n    },\n    \"rules\":{            // 转发规则，域名对应的服务器组，default 表示默认转发组。格式为：domain:group。如：imohe.com:normal, google.com:gfw, facebook.com:gfw\n        \"default\": \"normal\"\n    },\n    \"filters\": [         // 查询过滤规则，暂时未实现。计划用于域名查询过滤，如：过滤广告域名\n        {\n            \"host\": \"facebook.com\",\n            \"type\": \"AAAA\",\n            \"matching\": \"contains\"\n        }\n    ],\n    \"mapper\": [          // 域名与查询结果映射，可以用于内部非公开的域名解析服务\n        \"www.imohe.com:192.168.1.1\", \n        \".demo.imohe.com:192.168.1.2\", \n        \"git.imohe.com:192.168.1.3\"\n    ],\n    \"logger\": {         // 日志记录\n        \"Level\":\"debug\",\n        \"Access\":true,\n        \"Runtime\":true\n    }\n}\n```\n\n# 后期开发计划：  \n1、补上单元测试代码  \n2、支持 SSL 证书，提升安全性  \n3、对查询比较频繁的域名通过后台线程方式自动更新，以提升整体的性能  \n4、加强域名与查询结果映射，实现完整的 DNS 查询支持（目前只支持 ipv4 的 A 记录查询）  \n\n# 开发环境简单的性能测试：  \n```bash\ngoos: windows  \ngoarch: amd64  \npkg: imohe/dnsproxy  \nBenchmarkDig-4             10000            178410 ns/op  \nPASS  \nok      imohe/dnsproxy  2.181s  \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsg2008%2Fdnsproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsg2008%2Fdnsproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsg2008%2Fdnsproxy/lists"}