| Crates.io | single-use-dns |
| lib.rs | single-use-dns |
| version | 0.1.0 |
| created_at | 2020-03-19 17:56:58.221826+00 |
| updated_at | 2020-03-19 17:56:58.221826+00 |
| description | Simple throwaway dns server that temporarily hosts records for a single domain name |
| homepage | |
| repository | https://github.com/m-ou-se/single-use-dns |
| max_upload_size | |
| id | 220524 |
| size | 32,440 |
Simple throwaway dns server that temporarily hosts records for a single domain name.
Useful to temporarily host a DNS record, such as a ACME DNS-01 challenge.
$ single-use-dns --domain _acme-challenge.example.com --txt O_FFiiKTKtSYllnIKhXteCYji_d2vDk_FFiiKTKtSYl
Listening on [::]:53 (UDP and TCP)
Serving 1 record(s) for _acme-challenge.example.com
acme.shTo use this tool with acme.sh, add a script like the
following in ~/.acme.sh/dns_single_use.sh:
#!/usr/bin/env sh
dns_single_use_add() {
single-use-dns --domain "$1" --txt "$2" &
}
dns_single_use_rm() {
killall single-use-dns
}
Make sure the domain(s) you're going to use this with have an NS record
for the _acme-challenge subdomain pointing to the server you run this on.
Then you should be able to run acme.sh with the --dns dns_single_use option:
$ acme.sh --issue --dns dns_single_use --dnssleep 0 -d '*.example.com'
You can add the --listen option to the single-use-dns command if you want
it to listen on a specific ip-address instead of the wildcard address:
--listen [fdff:1234:1234:1234::2]:53.
To allow this tool to handle traffic on the DNS port (UDP and TCP port 53) on
Linux without running as root, you can give it the CAP_NET_BIND_SERVICE capability:
sudo setcap CAP_NET_BIND_SERVICE=+ep ./single-use-dns
Make sure only the user account(s) that should be allowed to run it can execute it.