DNS Handling uses LibSQL (compatible with Turso) as its database backend, with SQL migrations embedded directly in the binary. The database stores domain records, ACME account keys, in-flight certificate orders, DNS-01 challenge data, and issued certificates. No external migration tooling is required — migrations run automatically each time the service starts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/plutoploy/dns-handling/llms.txt
Use this file to discover all available pages before exploring further.
Database Driver
The service uses the official LibSQL Go client:"libsql" name and is used via the standard database/sql interface, so it works transparently with both local SQLite files and remote Turso databases over the same LibSQL protocol.
Connection Modes
Set theDATABASE_URL environment variable to select a connection mode. The default is a local SQLite file suitable for development.
Local File (SQLite)
Remote Turso
<database-name> with your Turso database name and <token> with a valid database auth token. The service connects over the LibSQL wire protocol — no additional configuration is needed beyond the DATABASE_URL.
Migrations
SQL migrations are embedded into the compiled binary at build time using Go’s//go:embed directive. On startup, db.Migrate() reads every .sql file from the embedded migrations/ directory, sorts them lexicographically by filename (e.g. 001_initial.sql, 002_next.sql, …), and executes each one against the database in order.
All statements in the migration files use CREATE TABLE IF NOT EXISTS, making every migration idempotent. The service does not track a schema version table — it is safe to restart the service against an already-initialized database without side effects.
Schema
The initial migration (001_initial.sql) creates five tables that cover the full lifecycle of domain verification and certificate issuance.
Table Reference
| Table | Purpose |
|---|---|
domains | Tracks every custom domain submitted to the service, its DNS verification token, and its current status (pending, verified, etc.). |
acme_accounts | Stores ACME account key pairs (PEM-encoded). Each account is identified by its Key ID (kid) returned by the CA on registration. |
acme_orders | Records active ACME certificate orders placed with the CA, linked to a domain. Includes the CA-assigned order_url and expiry time. |
acme_challenges | Holds DNS-01 challenge details for each authorization: the token, the computed key_authorization value that must appear in the DNS TXT record, and the current challenge status. |
certificates | Stores issued TLS certificates and their corresponding private keys (both PEM-encoded), along with issuance and expiry timestamps. |
Migrations run on every startup and are fully idempotent. Because every
CREATE TABLE statement uses IF NOT EXISTS, re-running migrations against an existing database is safe and produces no errors. There is no migration version tracking table — the service simply replays all embedded SQL files on each boot.