{"id":15903662,"url":"https://github.com/erikh/ldnsd","last_synced_at":"2025-03-20T20:30:52.521Z","repository":{"id":145967198,"uuid":"261609028","full_name":"erikh/ldnsd","owner":"erikh","description":"Light DNSd: 0 ttl, A-record service with remote control for simple DNS needs","archived":false,"fork":false,"pushed_at":"2020-11-08T07:52:25.000Z","size":70,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T17:49:34.272Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erikh.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-05T23:55:46.000Z","updated_at":"2021-05-13T13:37:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"af6f3b91-a2b3-4f4c-b143-24a5f6065d8f","html_url":"https://github.com/erikh/ldnsd","commit_stats":{"total_commits":50,"total_committers":1,"mean_commits":50.0,"dds":0.0,"last_synced_commit":"309a80104b06cc8189441d48b8ef12eeee39860a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fldnsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fldnsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fldnsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikh%2Fldnsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikh","download_url":"https://codeload.github.com/erikh/ldnsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244685439,"owners_count":20493269,"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":[],"created_at":"2024-10-06T12:03:38.314Z","updated_at":"2025-03-20T20:30:52.510Z","avatar_url":"https://github.com/erikh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ldnsd: Light DNSd: a small, 0 ttl A record store that is remotely programmable.\n\nLight DNSd is largely designed for testing \u0026 small environments, providing an\neasy to manage DNS service that serves the minimum necessary to deliver name\nservices centrally. Compare with a remotely programmable `/etc/hosts` file that\nlives in a central location. ldnsd comes with `ldnsctl` which can handle the\nprogramming, or use/generate GRPC-compliant clients from our protobuf\ndefinitions to program it inside of your tools directly.\n\nLight DNSd is backed by sqlite3 and provides very few features:\n\n- No recursion\n- No caching (although this may be added soon, see _Potential Issues_)\n- No forwarding\n- All records are 0 TTL\n\nSince not all clients are very happy with how ldnsd sees the world (simply), it\nis _strongly advised_ that you front it with a caching, recursive,\nstandards-compliant nameserver like coredns, bind, dqcache/dnscache, etc,\nespecially for the purposes of servicing client resolvers. Think of ldnsd more\nas a companion to your DNS stack instead of replacing it.\n\n## Installing\n\nInstalling a release is your best choice. Otherwise, you can still `go get github.com/erikh/ldnsd/...`\nand get the desired result in your `$GOBIN` or `$GOPATH/bin`.\n\n### Docker Image\n\nIf you wish to use Docker to power ldnsd, you can use our `erikh/ldnsd`\nversion-tagged images. Running with `--net=host` is advisable to avoid the UDP\nproxy docker provides as it tends to drop packets under high load.\n\nExample usage:\n\n```bash\n# start the service\n$ docker run -it -d --name ldnsd --net=host erikh/ldnsd:0.1.0\n# configure some hosts\n$ docker exec -it ldnsd ldnsctl set myhost 1.2.3.4\n$ dig myhost.internal. @127.0.0.1\n```\n\n### Manual Installation\n\nIf you'd like to build in a container or build the release version, just make\nsure to have `docker` installed; [box](https://github.com/box-builder/box) will\nbe installed as root as a part of the process during the first run while\ncreating the shell image.\n\nTo create a release tarball:\n\n```shell\n$ make shell\n# \u003cinside the container\u003e\n$ make release # out comes the tarball in the CWD\n```\n\n### Make a CA\n\nYou'll need a CA. I strongly recommend installing\n[mkcert](https://github.com/FiloSottile/mkcert) and trying this script to\ngenerate the CA, one server cert, and one client cert in `/etc/ldnsd` (you may\nneed to be root to write to this directory):\n\nThis will only make the service available on `localhost/127.0.0.1` through this\ncert. All other attempts will be rejected.\n\nNote if you change the directories, you will need to adjust the configuration file, which is discussed below.\n\n```shell\nexport CAROOT=\"/etc/ldnsd\"\nmkcert -install\nmkcert -ecdsa -cert-file /etc/ldnsd/server.pem -key-file /etc/ldnsd/server.key localhost 127.0.0.1\nmkcert -ecdsa -client -cert-file /etc/ldnsd/client.pem -key-file /etc/ldnsd/client.key localhost 127.0.0.1\n```\n\n### Configuration\n\n`ldnsd` takes one argument, the configuration filename. It is a basic YAML\ndocument that covers certificate management and network listening information.\n\nHere is an example. If in doubt, all options have defaults:\n\n```yaml\n# vim: ft=yaml\n---\ncertificate:\n  ca: \"/etc/ldnsd/rootCA.pem\"\n  cert: \"/etc/ldnsd/server.pem\"\n  key: \"/etc/ldnsd/server.key\"\n# grpc listening port\ngrpc: \"localhost:7847\"\n# dns listening port (udp only!)\nlisten: \"localhost:53\"\n# TLD for domains.\ndomain: \"internal\"\n```\n\n## Launching and Utilization\n\n`ldnsd my.conf` to launch the service, it does not daemonize so be sure to run\nit in the background if you need to. Also, since :53 is privileged port, you\nwill need to run this process as root.\n\n`ldnsctl` can be used to query and manipulate the service. To resolve hosts, use DNS:\n\n```shell\ndig bar.internal. @127.0.0.1\n```\n\n\"Set\", \"List\" and \"Delete\" operations go through `ldnsctl`. To review how to\nuse those operations, please review the `ldnsctl help` command's output.\n\n## Potential Issues\n\nsqlite3 (and the way we use it) under a lot of contention could cause slow\nresponses, which could lead to dropped queries. There are benchmarks at the\nroot of the repository, if you are able to produce this behavior with them\nplease let us know.\n\nOn a 12 thread / 6 core intel 9xxx processor, the erikh/dnsserver package\ndelivers 7000ns/op for a similar test that ldnsd delivers in 30000ns/op,\nsuggesting that (understandably) sqlite3 is slower than map access. That said,\nextended \"burn-in\" benchmarks have shown no delivery issues so far.\n\nFor most other bugs, please see the Issues pages.\n\n## Author\n\nErik Hollensbe \u003cerik+git@hollensbe.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikh%2Fldnsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikh%2Fldnsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikh%2Fldnsd/lists"}