{"id":22098957,"url":"https://github.com/ciiiii/database","last_synced_at":"2025-07-28T08:07:05.705Z","repository":{"id":40308986,"uuid":"232002075","full_name":"ciiiii/database","owner":"ciiiii","description":"CoreDNS plugin for db backend","archived":false,"fork":false,"pushed_at":"2025-01-27T00:36:50.000Z","size":151,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T02:03:53.326Z","etag":null,"topics":["coredns","database","gorm"],"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/ciiiii.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,"zenodo":null}},"created_at":"2020-01-06T01:36:46.000Z","updated_at":"2023-11-14T02:18:29.000Z","dependencies_parsed_at":"2025-07-24T22:34:15.185Z","dependency_job_id":"066b067f-4b55-4760-8156-176e4ee63662","html_url":"https://github.com/ciiiii/database","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ciiiii/database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciiiii%2Fdatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciiiii%2Fdatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciiiii%2Fdatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciiiii%2Fdatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ciiiii","download_url":"https://codeload.github.com/ciiiii/database/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciiiii%2Fdatabase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267482004,"owners_count":24094508,"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-28T02:00:09.689Z","response_time":68,"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":["coredns","database","gorm"],"created_at":"2024-12-01T04:26:35.330Z","updated_at":"2025-07-28T08:07:05.661Z","avatar_url":"https://github.com/ciiiii.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# database\nCoreDNS plugin for db backend\n\nUsage:\n\n1. clone CoreDNS repo\n\n```bash\n$git clone https://github.com/coredns/coredns.git\n$git checkout v1.6.6\n```\n\n1. edit `plugin.cfg`(add db dialects according [gorm doc](https://gorm.io/docs/connecting_to_the_database.html) )\n```bash\ndatabase:github.com/ciiiii/database\ndatabase_postgres:github.com/jinzhu/gorm/dialects/postgres\n```\n\n2. build CoreDNS\n\n```bash\n$make\n// generate binary coredns\n```\n\n3. edit Corefile\n\n```bash\nservice.dns {\n  database postgres {\n    username user\n    password password \n    host 127.0.0.1\n    port 5432\n    db coredns\n    ssl disable\n    debug\n  }\n}\n```\n\n4. run\n\n```bash\n$./coredns\n```\n\n5. insert dns record to your db\n\n```sql\ninsert into services(name, host, ttl) values ('example.service.dns.', '127.0.0.1', 100);\n```\n\n6. test\n\n```bash\n$dig @127.0.0.1 example.service.dns\n\n; \u003c\u003c\u003e\u003e DiG 9.10.6 \u003c\u003c\u003e\u003e @127.0.0.1 example.service.dns\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; -\u003e\u003eHEADER\u003c\u003c- opcode: QUERY, status: NOERROR, id: 52319\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1\n;; WARNING: recursion requested but not available\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;example.service.dns.\t\tIN\tA\n\n;; ANSWER SECTION:\nexample.service.dns.\t100\tIN\tA\t127.0.0.1\n\n;; Query time: 2 msec\n;; SERVER: 127.0.0.1#53(127.0.0.1)\n;; WHEN: Fri Jan 10 14:53:45 CST 2020\n;; MSG SIZE  rcvd: 83\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciiiii%2Fdatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciiiii%2Fdatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciiiii%2Fdatabase/lists"}