Getting started
This takes you from nothing to a running Salt with a primary, two
public edges, and your first signed zone. It uses the example stack in
deploy/examples/. Names such as salt-dns.example are placeholders: use a
domain you control.
What you are building
registrar --NS--> ns1.salt-dns.example, ns2.salt-dns.example (the edges)
internet --53--> knot-edge-1 ┐
internet --53--> knot-edge-2 ┤ public secondaries, no keys, no database
│ TSIG-authenticated zone transfers
knot-primary <--control socket--> app --- Postgres
^ ^
│ └ web, API, RFC 2136
DNSSEC keys behind your reverse proxy- Catalogs. Zones reach the edges, and any secondary of your own, through
catalog zones (RFC 9432): the edges follow one catalog that lists every active
zone,
edge.catalog.invalid, written by Salt, so adding zones or organisations never changes an edge's configuration. Each organisation also has its own catalog for its own secondaries (secondaries.md). - Postgres is the system of record. Everything else can be rebuilt from it (except the DNSSEC keys, which you back up: see operations).
- The app serves the web console, the REST API, the PowerDNS-compatible API and the RFC 2136 update service, and drives the primary over its control socket.
- The primary signs zones. It is not in any NS record; it may be private or reachable from the internet (the primary).
- The edges answer queries. Put them on different hosts and networks.
1. Prepare
You need Docker with Compose, a host name for the console
(dns.salt-dns.example), two public addresses for the edges, and a reverse
proxy that terminates TLS for the console.
cd deploy/examples
cp .env.example .env
Fill in .env. Generate the secrets:
openssl rand -hex 24 # POSTGRES_PASSWORD
openssl rand -base64 64 | tr -d '\n=' # SECRET_KEY_BASE
openssl rand -base64 32 # SALT_DNS_VAULT_KEY
openssl rand -base64 32 # KNOT_TRANSFER_KEY_SECRET
Keep a copy of SALT_DNS_VAULT_KEY somewhere other than the server; without
it the stored TSIG secrets cannot be read. Every variable is explained in
configuration.md.
Build the image (or use one you published):
docker build -t salt-dns:latest ../..
2. Start
docker compose -f compose.production.yml up -d
docker compose -f compose.production.yml ps
The app applies database migrations and starts. When everything is healthy:
curl -fsS http://127.0.0.1:4000/ready
# {"status":"ok","checks":{"oban":"ok","postgres":"ok","knot":"ok"}}
/up says the process is alive; /ready also checks Postgres, the Knot
control socket and the job queue. Neither needs authentication nor shows
internals.
3. Put the reverse proxy in front
Terminate TLS for PHX_HOST and forward to 127.0.0.1:4000. The proxy must
set the client address header, and SALT_DNS_TRUSTED_PROXIES must name the
address the proxy connects from, otherwise every client shares one rate limit.
Examples are in the comments at the end of compose.production.yml.
4. Publish the edges
Point the host's public addresses at the edge containers by setting
EDGE_1_PUBLISH and EDGE_2_PUBLISH (for example 203.0.113.10:53) and
UPDATE_PUBLISH for the RFC 2136 listener, then create A/AAAA records for
ns1.salt-dns.example and ns2.salt-dns.example at your registrar or in the
parent zone, and use those names in SALT_DNS_NAMESERVERS.
5. Sign in and create a zone
Sign in through your OpenID Connect provider (SALT_DNS_OIDC_*), or create
the first user from the command line. E-mail delivery is not configured in
this release, so confirmation and login links cannot be sent:
docker compose -f compose.production.yml exec \
-e SALT_DNS_FIRST_USER_EMAIL=you@salt-dns.example \
-e SALT_DNS_FIRST_USER_PASSWORD='a long passphrase' app \
/app/bin/salt_dns eval SaltDns.Release.create_user_from_env
If you set SALT_DNS_OIDC_AUTO_CREATE=invited (recommended for a public
installation), nobody can create the first organisation yet. Make it and invite
its first owner from the command line, then that person signs in through the
provider:
docker compose -f compose.production.yml exec app \
/app/bin/salt_dns eval 'SaltDns.Release.create_organisation("My company")'
docker compose -f compose.production.yml exec app \
/app/bin/salt_dns eval 'SaltDns.Release.invite("you@salt-dns.example", 1, :owner)'
Later, an owner or admin invites a person who has no account on the members page: enter the e-mail address and a role. Salt sends no message, so tell the person to sign in with that address. See Members and invitations.
Then sign in at https://dns.salt-dns.example and create an organisation. Add a zone.
It starts pending: it is not served until you prove you own it, either by
delegating it to your nameservers at the registrar or by adding the
_salt-dns-challenge TXT record the console shows. Salt checks it (at
once when you press "Check now", then after 1, 5 and 15 minutes, then hourly,
for the verification window) and activates the zone. How the check looks
records up, and how long a wrong "missing" can last, is in
operations.md.
Turn on DNSSEC for the zone, then publish the DS record the console shows at your registrar.
6. Create credentials and connect clients
In the console, create an API token or a TSIG key with exactly the grants a
client needs (for example only TXT on _acme-challenge of one zone). The
secret is shown once. The console prints ready-made snippets for each
credential; the same recipes are in clients.md.
- REST API reference:
https://dns.salt-dns.example/api/v1/openapi.json(OpenAPI 3.1; the same file ispriv/static/openapi.jsonin the source). - PowerDNS-compatible API for tools that already speak it: clients.md.
- Your own secondaries: secondaries.md.
Running it day to day
Backups, upgrades, key rotation and rebuilding Knot are in operations.md.