Skip to main content
The DNS page (Infrastructure, DNS) manages whole zones (a zone is all the DNS records for one domain) at the DNS provider you already connected for certificates: Cloudflare, Amazon Route53 or Google Cloud DNS. From here you can create a zone, move a domain’s name servers to it, import what the domain serves today, edit records, and check that the world sees your changes. The CLI has the same surface under levelrail-cli dns, and the API lives under /api/v1/dns. Nothing here is a DNS server of its own. Zones and records live at the provider; the control plane calls its API with the credentials stored under Domains, DNS provider.

Connect a provider

Zone management reuses the DNS-01 credentials from Domains and ingress. Zone level work needs a little more access than DNS-01 alone.
Create an API token (never the global API key) with:
A new zone is created in the account the token’s existing zones belong to. When the token sees several accounts, pass --account-id to dns zones create.
When several providers are connected, Cloudflare is the default, then Route53, then Google Cloud DNS. --provider route53 or --provider googleclouddns (or ?provider=) picks another one. Tokens are envelope encrypted at rest, never returned by any API, and never written to logs or audit rows.

Bring a domain onto a zone

The Add zone wizard has four steps, and levelrail-cli dns zones ... does the same from a terminal.
  1. Domain. Enter the registrable domain (example.com, not www.example.com). The zone is created at the provider.
  2. Name servers. The provider assigns name servers to the zone. Set exactly these at your registrar, replacing the current ones; a mix of old and new answers inconsistently.
  3. Import records. Before switching, copy what the domain serves today. Zone transfers (AXFR) are almost always refused, so the wizard looks up a list of common names (@, www, mail, api, DKIM selectors, _dmarc, common SRV names and more) at the domain’s current name servers and shows what it found. Untick anything you do not want and add any other names you use. Only the sets you keep are imported.
  4. Verify. The system resolver, 1.1.1.1 and 8.8.8.8 are asked for the domain’s NS records and compared with the zone’s assigned servers.
A resolver that returns a subset of the assigned servers counts as a match: a registrar given two of Route53’s four servers still delegates correctly. Registries usually publish a name server change within an hour, but resolvers may keep the old answer for up to two days.

Records

The zone page lists record sets: all values of one name and type together. Search matches names, values and set identifiers. The type filter narrows results to one type. Lists longer than 50 sets are virtualized. Supported types are A, AAAA, CNAME, TXT, MX, CAA, SRV and NS (for delegating a subdomain; apex NS and SOA are provider managed and read only). Each type has its own fields in the record dialog, and every value is checked twice: in the browser for instant feedback and on the server, which parses each value with miekg/dns before anything reaches the provider.
Rules the server enforces:
  • A CNAME cannot share a name with any other record, in either direction.
  • A CNAME at the apex is refused on Route53 (use an A record or a Route53 alias) and allowed with a warning on Cloudflare, which flattens it.
  • A CNAME set holds exactly one value.
  • proxied applies to A, AAAA and CNAME on Cloudflare only. TTL 1 means automatic and is Cloudflare only.
  • TTL is otherwise between 30 seconds and 7 days. The default is APP_DNS_DEFAULT_TTL, or 300 seconds.
  • TXT values are the raw text; splitting into 255 byte strings and quoting is handled for you.
Route53 alias records are shown read only; edit them in the AWS console.

Routing policies (Route53)

On Route53, a record set can use a routing policy. Several sets then share a name and type and are told apart by a set identifier.
A name cannot mix simple and routed sets of the same type. Cloudflare has no equivalent in plain DNS (its load balancing is a separate paid product), so routing policies are refused there with a clear error.

Import and export

Import accepts a BIND zone file or the JSON this page exports, as a file or pasted text. It always produces a plan first: what will be created, updated, deleted or left alone, with conflicts flagged. Nothing changes until you apply a plan without conflicts. By default an import never deletes anything, so records the file does not mention stay put. Replace deletes record sets missing from the file (never apex NS, SOA or alias sets) and requires typing the zone name.
Routed and alias sets have no zone file form; a BIND export lists them as comments, and the JSON export keeps them.

Templates

Templates add common setups as a plan you review before applying: TXT values already at the same name are kept (verification tokens survive), except a second SPF or DMARC record, which would break mail authentication.

Health and propagation

The zone overview shows record counts by type, the delegation state, and the last change made through this control plane (who and which action), falling back to the provider’s own modified time. The Propagation tab, or levelrail-cli dns check, asks one name and type of the system resolver, 1.1.1.1, 8.8.8.8, and, when the zone is known, each of the zone’s own name servers directly. Each answer shows its values and remaining TTL, whether all answers agree, and whether each matches what the zone holds. A resolver that still differs from the authoritative answer is waiting out its TTL.
Set APP_DNS_PUBLIC_RESOLVERS to a comma separated list of resolvers (default 1.1.1.1,8.8.8.8,9.9.9.9), or to off to ask only the system resolver, for example on a network that blocks outbound DNS. APP_DNS_LOCAL_CACHE_FALLBACK (default 5m) is the wait shown when this server’s resolver does not report how long it will keep an old answer.

Wildcard subdomains

An app can serve every name under a domain: add *.example.com (or *.apps.example.com) as one of its domains.
  • Only a single leading *. label is allowed. *.com, *.*.example.com and a.*.example.com are refused.
  • An exact domain always wins: if another app owns api.example.com, requests for it go to that app, and every other name under *.example.com goes to the wildcard app. A wildcard matches exactly one label, so *.example.com does not match a.b.example.com.
  • The certificate must come from DNS-01, because HTTP-01 cannot issue wildcard certificates. Adding a wildcard domain is refused until Cloudflare, Route53 or Google Cloud DNS is connected; the error links to the Domains page and names the CLI command.
  • When the provider manages the domain’s zone, a * A record pointing at this server is created for you. An existing * record is never overwritten.
  • The domain check resolves a random name under the wildcard, so it tests the wildcard record rather than a cached exact name. The Domains table marks these domains Wildcard.
Per environment and preview environment wildcards are not part of this yet.

Credential check on save

Saving a Cloudflare token, a Route53 key pair or a Google Cloud DNS key also tests it with read-only calls (list zones, then list records of the first zone). The save always succeeds; the response adds verification with ok, missing_scopes, zones_visible and message. Edit rights cannot be proven without a write, so they are confirmed on the first change. Turn this off with the runtime setting dns.verify_provider_on_save.

Roll back a domain change

Every go-live and apex and www apply is recorded with what it created or replaced. For a limited time you can undo one change, and only the records Levelrail itself wrote are ever touched.
GET /api/v1/domains/{domain}/changes lists the changes with rollback_until, can_rollback and already_undone. POST /api/v1/domains/{domain}/changes/{id}/rollback needs the root ability and answers 409 once the window has closed. A record that was edited after the change is skipped and reported, never deleted. The window is the runtime setting domains.rollback_window_minutes (default 60, 1 to 10080, env APP_DOMAINS_ROLLBACK_WINDOW_MINUTES seeds it).

Permissions and audit

Reads (zones, records, delegation, checks, exports) need the read ability. Every write against the provider (zones, records, imports, templates, health checks) needs root, because it changes live infrastructure outside this server. Each write is audited with an action name (dns_zone.create, dns_zone.delete, dns_record.create, dns_record.update, dns_record.delete, dns_record.import, dns_record.template, dns_health_check.create, dns_health_check.delete); filter the audit log by dns_record or dns_zone. Deleting a zone requires typing its name, and a zone that still has records beyond NS and SOA also needs force (--force). Export it first.

Limits

  • Discovery before delegation is a best effort lookup of common names; names nobody guessed are not found. Add them in the wizard.
  • Cloudflare zone listings do not include a record count; Route53 does.
  • Route53 private hosted zones are listed but have no delegation to verify.
  • Each change is applied as it is planned, one record set at a time; a provider error part way through an import stops it and reports how many changes landed.

Troubleshooting

The DNS provider credential is rejected

The control plane cannot authenticate with the DNS provider. Likely cause: the token or access key is invalid, expired, or has insufficient permissions. How to confirm: go to Settings > Domains > DNS provider and check which provider is listed. Try to perform any DNS action (list zones, check propagation) from the CLI or dashboard and look for a permission or authentication error. Fix: verify the token’s permissions match what the Connect a provider section requires. For Cloudflare, confirm the token is an API token (not the global API key) and has Zone.Zone.Read and Zone.DNS.Edit. For Route53, check that the IAM access key has the required actions. If the token is correct but still fails, regenerate a new one at your provider and update the credential.

Zone delegation shows “not delegated” or “partially delegated”

Name servers have not been updated at the registrar yet, or they are wrong. Likely cause: the name servers set at your registrar do not match what the DNS provider assigned, or the change is still propagating through DNS caches worldwide. How to confirm: run levelrail-cli dns zones verify example.com, or open the domain on the DNS page and check the Propagation tab. The output shows what resolvers are returning and what the zone assignment was. Fix: copy the exact name servers from step 2 of the Add zone wizard (levelrail-cli dns zones nameservers example.com) and update them at your registrar. Name server changes can take up to 2 hours to propagate globally, but typically appear within 15 minutes. Re-check with levelrail-cli dns zones verify example.com after the propagation completes.

A DNS record was added but the propagation tab shows old values

DNS caches worldwide are still serving the old answer before the TTL expires. Likely cause: the DNS record was recently changed, and resolvers have cached the old value until the TTL expires. How to confirm: run levelrail-cli dns check <name> --type <type> and check the TTL column. The remaining TTL is how long resolvers will keep serving the old answer. Fix: wait for the TTL to expire. If you need the new record immediately, reduce the TTL before making the change next time (minimum 30 seconds), or use a resolver that does not cache (ask 8.8.8.8 directly with dig @8.8.8.8 <name>). The system resolver on the control plane may also be caching; restart the resolver service or wait for its cache to expire.

Import or export fails with an error about conflicting records

The import plan detected records that would break DNS rules. Likely cause: the zone file being imported has records that conflict with existing ones, such as two values for a CNAME, or a CNAME sharing a name with another record type. How to confirm: run levelrail-cli dns records import example.com --file file.zone (without --apply) to see the plan and any conflicts listed. Fix: edit the zone file to remove the conflicting records, or review the plan and skip importing the conflicting sets. CNAME records cannot share a name with any other record type, and each CNAME name can have only one value.

A wildcard domain route is not matching requests

Requests to subdomains of the wildcard domain are not reaching the app. Likely cause: a wildcard certificate is needed, which requires DNS-01 ACME. Wildcards cannot use HTTP-01. Or, an exact domain record is taking precedence over the wildcard. How to confirm: go to Settings > Domains > DNS provider to check if Cloudflare or Route53 is connected. Open the domain on the Domains page and check if the certificate is issued. Also check whether an exact subdomain is defined for the same domain. Fix: connect a DNS provider if you have not already, then enable DNS-01 for the wildcard domain. If an exact domain is already configured (e.g., api.example.com) and you want requests for other subdomains to go to the wildcard app, remove the exact domain from the wildcard-serving app, or assign the exact domain to a different app. Still stuck? Run levelrail-cli dns check <domain> and attach its output to an issue on GitHub.

Roadmap

How the Route53 feature set maps onto this page: Also later: ownership TXT markers (as Kubernetes external-dns does) so imports can tell records this platform created from foreign ones, and Cloudflare load balancing pools.

Apex and www plan

levelrail domains www-plan <app> <domain> [--mode both|apex_only|www_only] [--canonical apex|www] [--no-redirect] previews the records a bare domain needs and the 308 redirect between the two hosts (GET /api/v1/apps/{name}/domains/{domain}/dns/plan). Mode and canonical default to the live settings domains.www_mode and domains.canonical. It is read only: nothing is written to your DNS provider. The plan also does a public DNS lookup and reports www_attached, www_points_here, apex_points_here and www_redirects; with no provider connected, each record carries current addresses and a state of already_correct or missing from that lookup. levelrail domains www-apply <app> <domain> [--mode both|apex_only|www_only] [--canonical apex|www] [--replace] [--no-redirect] [--attach] [--yes] writes those records (POST /api/v1/apps/{name}/domains/{domain}/dns/apply, body {mode, canonical, replace, confirm, redirect, attach}; attach: true (--attach) first adds the www twin to the app when it is missing, so its route and certificate follow, and works even when no DNS provider holds the zone (then no DNS is written); redirect: false (--no-redirect) leaves the redirect alone so both hosts serve the app; the plan takes ?redirect=false). It needs the root ability and confirm: true (the CLI sets it with --yes; without it the plan is printed). Each write is audited and tracked like any other managed record. Conflicting records are reported and kept unless replace is set. The first failed write stops the run, and the result lists every record as done, failed or not attempted, plus the undo actions. In both mode the 308 redirect is saved too when the www twin is already attached to the app; otherwise redirect_applied is false with the reason.
Last modified on November 7, 2026