{"id":29832489,"url":"https://github.com/diamondgotcat/dgc-dns","last_synced_at":"2025-07-29T11:37:22.220Z","repository":{"id":300078675,"uuid":"1005141366","full_name":"DiamondGotCat/DGC-DNS","owner":"DiamondGotCat","description":"A Practical and Lightweight Open-Source DNS Server","archived":false,"fork":false,"pushed_at":"2025-06-19T19:39:06.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T19:39:26.448Z","etag":null,"topics":["dns","dns-server","server"],"latest_commit_sha":null,"homepage":"","language":"Python","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/DiamondGotCat.png","metadata":{"files":{"readme":"README.ja.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T18:30:32.000Z","updated_at":"2025-06-19T19:39:09.000Z","dependencies_parsed_at":"2025-06-19T19:50:37.798Z","dependency_job_id":null,"html_url":"https://github.com/DiamondGotCat/DGC-DNS","commit_stats":null,"previous_names":["diamondgotcat/dgc-dns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DiamondGotCat/DGC-DNS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondGotCat%2FDGC-DNS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondGotCat%2FDGC-DNS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondGotCat%2FDGC-DNS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondGotCat%2FDGC-DNS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiamondGotCat","download_url":"https://codeload.github.com/DiamondGotCat/DGC-DNS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondGotCat%2FDGC-DNS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267678465,"owners_count":24126337,"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-07-29T02:00:12.549Z","response_time":2574,"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","dns-server","server"],"created_at":"2025-07-29T11:36:26.258Z","updated_at":"2025-07-29T11:37:22.213Z","avatar_url":"https://github.com/DiamondGotCat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"| [English](README.md) | 日本語 |\n\n# DGC-DNS\n実用的で軽量なオープンソースのDNSサーバー\n\n## DGC-DNSについて\nDGC-DNSは、Pythonで書かれた、実用的で軽量なDNSサーバーです。\n\n## ドメイン処理システム\nDGC-DNSには、以下の2つの名前解決システムがあります。\n- ローカル解決: DGC-DNSに設定されたDNSレコードを使用して応答します。レコードがない場合、他の名前解決システムを使用してから、NXDOMAINを返します。\n- パブリックDNSによる解決: 自動的にインターネットにあるDNSに要求することで、ローカル解決で回答不可能だったドメインもある程度解決できるようになります。\n  - `main.py`内の`fallback_servers = [\"1.1.1.1\", \"1.0.0.1\", \"8.8.8.8\", \"8.8.4.4\"]`の部分を変更することで、他のパブリックDNSも使用可能です。\n  - パブリックDNSによる解決の場合、回答は自動的にキャッシュされ、次回からは同じリクエストにより高速に答えるようになっています。(`main.py`内の`@lru_cache(maxsize=1024)`を削除することで無効化できます。)\n\n### ローカル解決に使用されるDNSレコードの保存場所\nDNSレコードは全てスクリプトディレクトリの`records.json`に保存され、必要な時にロードされます。\n後述するDGC-DNS APIを使用すれば、リモートからリロードや、レコードの追加/編集/削除などの様々な機能を利用可能です。\n\n## DGC-DNS API\nDGC-DNSの操作は、APIで行うことができます。\n\n### セキュリティについて\nデフォルトでは自身(`localhost`)からのリクエストに対してのみ回答します。\nこれは、外部からのAPIアクセスに対応しないための方法の一つです。\n外部からも操作したい場合、`localhost`の方法をやめ、代わりにパスワードやAPIキーなどの方法を使用してください。\n\n### 操作の種類\n以下の操作をAPI経由で利用可能です。\n- `GET /api/v1/status`: 動作しているかどうかを判定するためのエンドポイントです。正常な場合は`{\"status\": \"ok\", \"content\": \"ok\"}`が返ってきます。\n- `GET /api/v1/reload`: `records.json`から再読み込みします。手動で編集した場合は、このエンドポイントを叩いてください。\n- `GET /api/v1/records`: 現在読み込まれている`records.json`の中身を返します。\n- `POST /api/v1/records/append`: DNSレコードを追加します。\n- `POST /api/v1/records/remove`: DNSレコードを削除します。\n- `POST /api/v1/records/edit`: DNSレコードを編集します。\n\n## 利用事例\nDGC-DNSは、開発者(DiamondGotCat)も使用しています。\n- `ns1.diamondgotcat.net`, `ns2.diamondgotcat.net`: `35.208.247.170`への別ルート。\n- `35.208.247.170`: 開発者のドメインを一括管理するDGC-DNSサーバー。\n\n## ライセンス\nこのソフトウェアはMITライセンス下で提供されます。\n\n---\nCopyright (c) 2025 DiamondGotCat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondgotcat%2Fdgc-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiamondgotcat%2Fdgc-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondgotcat%2Fdgc-dns/lists"}