{"id":13582282,"url":"https://github.com/Jamesits/SND","last_synced_at":"2025-04-06T14:30:38.872Z","repository":{"id":42479024,"uuid":"226547117","full_name":"Jamesits/SND","owner":"Jamesits","description":"Minimal authoritative PTR (rDNS, reverse DNS) resolver with automatic generation of records.","archived":false,"fork":false,"pushed_at":"2024-04-19T13:25:21.000Z","size":98,"stargazers_count":21,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T09:05:41.063Z","etag":null,"topics":[],"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/Jamesits.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":"2019-12-07T16:59:48.000Z","updated_at":"2025-01-07T16:22:20.000Z","dependencies_parsed_at":"2024-02-22T18:27:03.620Z","dependency_job_id":"8bb4e284-a6de-476e-bbcc-10060a46d33a","html_url":"https://github.com/Jamesits/SND","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamesits%2FSND","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamesits%2FSND/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamesits%2FSND/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jamesits%2FSND/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jamesits","download_url":"https://codeload.github.com/Jamesits/SND/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495630,"owners_count":20948087,"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-08-01T15:02:34.182Z","updated_at":"2025-04-06T14:30:38.630Z","avatar_url":"https://github.com/Jamesits.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# SND\r\n\r\nMinimal authoritative PTR (rDNS, reverse DNS) resolver with automatic generation of records.\r\n\r\n[![Build Status](https://dev.azure.com/nekomimiswitch/General/_apis/build/status/SND?branchName=master)](https://dev.azure.com/nekomimiswitch/General/_build/latest?definitionId=71\u0026branchName=master)\r\n[![](https://images.microbadger.com/badges/image/jamesits/snd.svg)](https://microbadger.com/images/jamesits/snd \"Get your own image badge on microbadger.com\")\r\n\r\n## Motivation\r\n\r\nSay you have a large collection of IP addresses (thousands of IPv4 /24 blocks, or one IPv6 /32 block), and you want to have PTR records on all of your IPs. Writing a zonefile and hosting it using any traditional authoritative DNS server is unrealistic: the zonefile will be of multiple GBs and you need an enormous amount of memory to even load it. \r\n\r\nSND provides you a simple alternative option: you name a base domain, and SND generates PTR records for you on the fly based on a set of pre-defined rules. \r\n\r\n```\r\n1.1.168.192.in-addr.arpa.                                                 1000 IN PTR 192.168.1.1.ptr.example.com.\r\n1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.0.d.f.ip6.arpa. 1000 IN PTR fd00.1.0.0.0.0.0.1.ptr.example.com.\r\n```\r\n\r\n## Requirements\r\n\r\n### Hardware\r\n\r\nSND can run on very little processing power (Raspberry Pis are fine) and a very small memory footprint (a few MBs) although the performance will be not optimal.\r\n\r\nAs of version 0.1.2, on a 4-core Intel E5-2670 VM with more than 2GiB memory, SND can process around 25K RPS.\r\n\r\n### Software\r\n\r\nOfficially supported OS: \r\n\r\n* Linux (kernel 4.19+ with glibc)\r\n* Windows (Windows Server 2016 or later, Windows 10 Desktop 1809 or later)\r\n\r\nOther OSes are not currently tested because of the lack of resources available to me.\r\n\r\n## Usage\r\n\r\n### Configure SND\r\n\r\nCopy over the self-documented [example config](contrib/config/config.toml) and tweak it for your own need. Please do not\r\nleave any `example.com` things in your own config. Remove what you don't need.\r\n\r\nCurrently no strict config file format checking is implemented -- you might crash the program if some important keys are\r\nmissing.\r\n\r\n### Set up SND\r\n\r\nIn most cases you are going to need 2 servers (or one server with 2 different IP addresses if you don't care about availability issues). Copy the exact same config file to both servers and launch SND on both of them:\r\n\r\nDownload the pre-compiled binary from [releases](https://github.com/Jamesits/SND/releases) to your server and run it:\r\n\r\n```shell\r\nchmod +x ./snd\r\n./snd -config path/to/config.toml\r\n```\r\n\r\nOr, if you prefer Docker:\r\n\r\n```shell\r\ndocker run --rm -p 53:53 -p 53:53/udp -v path/to/config.toml:/etc/snd/config.toml:ro snd:latest\r\n```\r\n\r\nRun a simple test using dig:\r\n\r\n```shell\r\n$ dig @localhost -x 192.0.2.1\r\n\r\n; \u003c\u003c\u003e\u003e DiG 9.11.5-P4-5.1-Debian \u003c\u003c\u003e\u003e @localhost -x 192.0.2.1\r\n; (1 server found)\r\n;; global options: +cmd\r\n;; Got answer:\r\n;; -\u003e\u003eHEADER\u003c\u003c- opcode: QUERY, status: NOERROR, id: 50924\r\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0\r\n;; WARNING: recursion requested but not available\r\n\r\n;; QUESTION SECTION:\r\n;1.2.0.192.in-addr.arpa.      IN      PTR\r\n\r\n;; ANSWER SECTION:\r\n1.2.0.192.in-addr.arpa. 3600  IN      PTR     192.0.2.1.example.com.\r\n```\r\n\r\n### Set up DNS records\r\n\r\nYou need at least 2 `A` or `AAAA` records pointing to each of your SND servers. You might need to set them up as glue records based on your actual config.\r\n\r\n```\r\nns1.example.com.\t3600\tIN\tA\t192.0.2.1\r\nns2.example.com.\t3600\tIN\tA\t192.0.2.2\r\n```\r\n\r\n### Set up PTR record delegation\r\n\r\nSet up a `domain` object at your RIR like this. \r\n\r\n```\r\ndomain:   \u003czone name\u003e\r\ndescr:    \u003cdescription\u003e\r\nadmin-c:  \u003cnic-handle for administrative contact\u003e\r\ntech-c:   \u003cnic-handle for technical contact\u003e\r\nzone-c:   \u003cnic-handle for zone contact\u003e\r\nnserver:  ns1.example.com\r\nnserver:  ns2.example.com\r\nmnt-by:   \u003cyour maintainer\u003e\r\n```\r\n\r\nDetailed instructions are provided per RIR:\r\n\r\n* [AfriNIC](https://afrinic.net/support/requesting-reverse-delegation)\r\n* [ARIN](https://www.arin.net/resources/manage/reverse/)\r\n* [APNIC](https://www.apnic.net/manage-ip/manage-resources/reverse-dns/)\r\n* [LACNIC](https://www.lacnic.net/685/2/lacnic/5-delegation-of-reverse-resolution)\r\n* [RIPE NCC](https://www.ripe.net/manage-ips-and-asns/db/support/configuring-reverse-dns)\r\n\r\nNotes:\r\n\r\n* The smallest IP block sizes available for delegation differ\r\n* Only RIPE NCC is currently tested because I cannot afford IP blocks from the other RIRs\r\n\r\n## Compilation\r\n\r\nGolang 1.22 or later is officially supported. Before starting, make sure the `GOROOT` and `GOPATH` environment\r\nvariables are set correctly and there is a `go` binary is in your `PATH`.\r\n\r\n```shell\r\ngit clone https://github.com/Jamesits/SND.git\r\ncd SND\r\ngo build github.com/jamesits/snd/cmd/snd\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamesits%2FSND","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJamesits%2FSND","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamesits%2FSND/lists"}