DNS over TLS and HTTPS set up in one step

jarl encrypted-dns setup (and the Encrypted DNS page) finds or obtains a
certificate for the host name, checks that nothing else listens on the
DoT and DoH ports at the chosen addresses (offering a free DoH port), and
stages named's tls statement and listeners as one change, keeping port 53
where it was when there was no listen-on, plus the host name's records in
the private views (local to the view in a linked zone). Status shows what
to give Android, Linux, Firefox, Chrome and Windows clients. A tls
statement with missing files is refused (tls_file_missing), and a
certificate named uses can't be deleted. docs/encrypted-dns.md, e2e with
real DoT and DoH queries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-10-12 17:09:14 +01:00
1 parent ebd3a3dfbe
commit 66dcf53684
21 files changed
+1790 -8

No files matched your search

+6
View File
@@ -336,6 +336,9 @@ func (m *Manager) Update(ctx context.Context, name string, in Input, p *auth.Pri
if err := m.checkUses(ctx, c); err != nil {
return nil, err
}
if before.HasUse(model.CertUseDNS) && !c.HasUse(model.CertUseDNS) && m.namedUses(ctx, m.FilesDir(c.Name)) {
return nil, inputErr("named's configuration uses certificate %s (a tls statement names its files), so it keeps the dns use: take it out of named first (jarl encrypted-dns disable)", c.Name)
}
if c.Source == model.CertSourceFile && (c.CertFile != before.CertFile || c.KeyFile != before.KeyFile) {
if _, err := m.readFiles(c); err != nil {
return nil, inputErr("%v", err)
@@ -373,6 +376,9 @@ func (m *Manager) Delete(ctx context.Context, name string, p *auth.Principal) er
if err != nil {
return err
}
if c.HasUse(model.CertUseDNS) && m.namedUses(ctx, m.FilesDir(c.Name)) {
return inputErr("named's configuration uses certificate %s (a tls statement names its files): take it out first (jarl encrypted-dns disable, or remove the tls statement)", c.Name)
}
if err := m.store.DeleteCertificate(ctx, c.ID); err != nil {
return err
}