{"id":30596532,"url":"https://github.com/ma6174/myhttpdns","last_synced_at":"2025-10-11T12:18:37.858Z","repository":{"id":57536280,"uuid":"87716075","full_name":"ma6174/myhttpdns","owner":"ma6174","description":"DNS 服务器，接收标准 DNS 查询请求，然后通过查询 http dns 获取结果返回给客户端。","archived":false,"fork":false,"pushed_at":"2019-06-16T01:36:02.000Z","size":237,"stargazers_count":55,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-29T22:04:12.864Z","etag":null,"topics":["dns","hosts","httpdns","ttl-cache"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ma6174.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":"2017-04-09T14:53:04.000Z","updated_at":"2025-02-20T14:50:20.000Z","dependencies_parsed_at":"2022-08-29T00:41:36.913Z","dependency_job_id":null,"html_url":"https://github.com/ma6174/myhttpdns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ma6174/myhttpdns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ma6174%2Fmyhttpdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ma6174%2Fmyhttpdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ma6174%2Fmyhttpdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ma6174%2Fmyhttpdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ma6174","download_url":"https://codeload.github.com/ma6174/myhttpdns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ma6174%2Fmyhttpdns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007146,"owners_count":26084247,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","hosts","httpdns","ttl-cache"],"created_at":"2025-08-29T21:44:22.886Z","updated_at":"2025-10-11T12:18:37.843Z","avatar_url":"https://github.com/ma6174.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# myhttpdns\n\nDNS 服务器，接收标准 DNS 查询请求，然后通过查询 http dns 获取结果返回给客户端。\n\n[![Build Status](https://travis-ci.org/ma6174/myhttpdns.svg?branch=master)](https://travis-ci.org/ma6174/myhttpdns)\n\n### 主要特性\n\n1. 对外通过 http dns 查询，避免 DNS 劫持\n2. 提供标准 DNS 查询接口，可以直接将机器的 dns 配置到 myhttpdns\n3. DNS 查询结果根据 TTL 进行缓存\n4. 对外 DNS 查询请求归并\n5. 提供详细的审计日志，包括请求来源 IP、缓存个数、请求的域名、TTL、响应时间以及解析结果\n6. 支持 hosts 文件与本地文件，可以通过文件名设置 TTL，比如 `hosts.600` 设置 TTL 为 600 秒\n7. http dns 查询失败改用默认的 DNS 查询\n8. 请求domain 为 `myip` 返回客户端的来源 IP\n9. 支持 Dnspod 和 Cloudflare 两家 dns\n\n\n### 如何安装\n\n\tgo get -v github.com/ma6174/myhttpdns\n\n### 如何使用\n\n\tsudo myhttpdns\n\n* 默认监听53端口需要管理员权限，可以增加`-bind \"127.0.0.1:8053\"`改变监听端口\n\n### 测试\n\n使用 dig 进行 dns 查询\n\n\n```bash\n$ dig +short @127.0.0.1 google.com\n216.58.200.46\n$ dig +short @127.0.0.1 google.com\n216.58.200.46\n$ dig +short @127.0.0.1 baidu.com\n180.149.132.47\n220.181.57.217\n111.13.101.208\n123.125.114.144\n$ dig +short @127.0.0.1 baidu.com\n180.149.132.47\n220.181.57.217\n111.13.101.208\n123.125.114.144\n```\n\n程序日志输出\n\n```bash\n$ sudo myhttpdns\n2017/04/09 22:37:49 dns server running at 0.0.0.0:53\n2017/04/09 22:37:53 127.0.0.1:59022\t139s\t24.213ms\tgoogle.com.\t[216.58.200.46]\n2017/04/09 22:37:54 127.0.0.1:50891\t138s\t0.075ms\tgoogle.com.\t[216.58.200.46]\n2017/04/09 22:37:58 127.0.0.1:56055\t98s\t22.455ms\tbaidu.com.\t[180.149.132.47 220.181.57.217 111.13.101.208 123.125.114.144]\n2017/04/09 22:37:59 127.0.0.1:55850\t97s\t0.057ms\tbaidu.com.\t[180.149.132.47 220.181.57.217 111.13.101.208 123.125.114.144]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fma6174%2Fmyhttpdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fma6174%2Fmyhttpdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fma6174%2Fmyhttpdns/lists"}