3 ms·
> I've read about this a few times now, but have been unable to find a good resource on how to set such a VM up. You first set up a VM and set up your favourit
by throw0101a 7y ago
> I've read about this a few times now, but have been unable to find a good resource on how to set such a VM up.
You first set up a VM and set up your favourite authoritative DNS software on it: popular choices are ISC's BIND and NLnet's NSD. Either will do. Call it (e.g.) ns-dnsauth.mydomain.com, which is Internet accessible only on udp/53 and tcp/53.
You have to then configure that DNS server to serve the domain (e.g.) dnsauth.mydomain.com.
Next you configure the DNS server software to allow dynamic updates. For ISC BIND, you can set up (crypto) keys and use the nsupdate(1) utility:
* https://www.zytrax.com/books/dns/ch7/xfer.html#allow-update https://www.zytrax.com/books/dns/ch7/xfer.html#allow-update
* https://dan.langille.org/2017/05/31/creating-a-txt-only-nsupdate-connection-for-lets-encrypt/ https://dan.langille.org/2017/05/31/creating-a-txt-only-nsup...
Point your public/external DNS records to your delegated-auth server by having (say) _acme-challenge.www.mydomain.com be a CNAME to (say) _acme-challenge.www.dnsauth.... LE will follow the CNAME and try to do the verification against the record in dnsauth sub-domain that lives on the ns-dnsauth VM.
Then you have your LE/ACME client(s) run a hook script to publish (and cleanup) the dns-01 TXT challenge records:
* https://dan.langille.org/2017/07/04/acme-sh-getting-free-ssl-certificates-installation-configuration-on-freebsd/ https://dan.langille.org/2017/07/04/acme-sh-getting-free-ssl...
* https://github.com/dehydrated-io/dehydrated/wiki/example-dns-01-nsupdate-script https://github.com/dehydrated-io/dehydrated/wiki/example-dns...
The LE client goes to the LE API, gets a verification token/nonce, executes the the hook script to push the TXT record to ns-dnsauth, the LE folks verify the record, the LE client (ideally) cleans up the TXT record, receives the cert for the LE API, puts it in the correct path and restarts your (web) service(s).
Someone actually wrote a limited-functionality DNS server that allows for pushing of records via a REST API for this purpose:
* https://github.com/joohoi/acme-dns https://github.com/joohoi/acme-dns
This way the 'heavier' BIND/NSD software doesn't have to be used, as those have more features than are needed.
- anonsivalley652 7y agoFor publicly-accessible infrastructure: 4-6 instances of pdns authoritative for a domain, and pdns recursor running locally for each box. And Cloudflare free tier while revenue can't justify rolling-out Varnish and other locally-deployed capacity/DDoS mitigations. It may also be a better idea to push DNS updates via configuration management or driven from something like Envoy so there's a history and a single-source-of-truth (SSOT) to point-to rather than multiple people doing manual tinkering, which is a labor-intensive, antiquated approach.
- throw0101a 7y agoIs "pdns" PowerDNS? * https://doc.powerdns.com/authoritative/dnsupdate.html https://doc.powerdns.com/authoritative/dnsupdate.html If we're just talking about issuing certs, I don't know why one need 4-6 instances for serving the dnsauth sub-domain.