{"id":25411715,"url":"https://github.com/koho/coredns-chinadns","last_synced_at":"2026-06-13T21:33:35.871Z","repository":{"id":65423913,"uuid":"591865427","full_name":"koho/coredns-chinadns","owner":"koho","description":"A simple ChinaDNS Plugin for CoreDNS","archived":false,"fork":false,"pushed_at":"2023-08-16T09:47:15.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T10:54:01.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-22T06:05:40.000Z","updated_at":"2023-09-17T09:06:10.000Z","dependencies_parsed_at":"2024-06-20T05:40:49.692Z","dependency_job_id":"1f6b664b-1538-4b8f-a81c-01a1dbfbe115","html_url":"https://github.com/koho/coredns-chinadns","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/koho/coredns-chinadns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fcoredns-chinadns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fcoredns-chinadns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fcoredns-chinadns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fcoredns-chinadns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koho","download_url":"https://codeload.github.com/koho/coredns-chinadns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fcoredns-chinadns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34301731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":[],"created_at":"2025-02-16T10:19:20.911Z","updated_at":"2026-06-13T21:33:35.856Z","avatar_url":"https://github.com/koho.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChinaDNS Plugin for CoreDNS\n\n## Name\n\n*chinadns* - fast and accurate dns for chinese users.\n\n## Description\n\nA CoreDns plugin that select a dns reply from two types of upstreams (main and fallback) with the following procedure:\n\n1. Make concurrent dns requests to main and fallback upstreams.\n2. Wait for a reply from main upstream.\n3. Use GeoIP database to determine IP country of main reply. If the main reply contains a China IP, then the reply is\n   selected and returned to client immediately. Otherwise, go to step 4.\n4. Wait for a reply from fallback upstream and return it to client.\n\nThis plugin applies to both IPv4 and IPv6 addresses.\n\n## Compilation\n\nA simple way to compile this plugin, is by adding the following on [plugin.cfg](https://github.com/coredns/coredns/blob/master/plugin.cfg) __right before the `forward` plugin__,\nand recompile it as [detailed on coredns.io](https://coredns.io/2017/07/25/compile-time-enabling-or-disabling-plugins/#build-with-compile-time-configuration-file).\n\n```txt\n# right before forward:forward\nchinadns:github.com/koho/coredns-chinadns\n```\n\nAfter this you can compile coredns by:\n\n```sh\ngo generate\ngo build\n```\n\nOr you can instead use make:\n\n```sh\nmake\n```\n\n## Syntax\n\n```txt\nchinadns DBFILE TO... {\n    block QUERY_TYPE\n    reload DURATION\n    except IGNORED_NAMES...\n}\n```\n\n* **DBFILE** the mmdb database file path. We recommend updating your mmdb database periodically for more accurate results.\n* **TO...** are the main destination endpoints to forward to. We usually add a dns server inside China to this list.\n* `block` specifies the query type blocked from fallback upstreams. It generates an empty answer list for this type as the response of fallback upstreams.\n* `reload` change the period between each database file reload. A time of zero seconds disables the feature.\n  Examples of valid durations: \"300ms\", \"1.5h\" or \"2h45m\". See Go's [time](https://godoc.org/time) package. Default is 30s.\n* **IGNORED_NAMES** in `except` is a space-separated list of domains to exclude from forwarding to fallback upstreams.\n  Requests that match one of these names will be only forwarded to main upstreams.\n\n## Examples\n\nCommon configuration.\n\n```corefile\n. {\n  chinadns /etc/cn.mmdb 223.5.5.5 114.114.114.114\n  forward . 8.8.8.8 tls://1.1.1.1\n}\n```\n\nIn this configuration, we block AAAA query that outside China:\n\n```corefile\n. {\n  chinadns /etc/cn.mmdb 223.5.5.5 {\n    block AAAA\n  }\n  forward . 8.8.8.8\n}\n```\n\nIn this configuration, we don't forward `example.com` to the fallback upstream `8.8.8.8`:\n\n```corefile\n. {\n  chinadns /etc/cn.mmdb 223.5.5.5 {\n    except example.com\n  }\n  forward . 8.8.8.8\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fcoredns-chinadns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoho%2Fcoredns-chinadns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fcoredns-chinadns/lists"}