◀ Knowledge hub

09, Domains & brand portfolio

Programmatic DNS and subdomain plays

codeAmani Labs Engineering
Cinematic still for Programmatic DNS and subdomain plays

DNS clicked by hand is DNS you cannot reproduce

When records are added by hand in a registrar dashboard, the configuration exists only in that dashboard and in the memory of whoever set it up. You cannot review it, you cannot diff it, and when something resolves wrong you are squinting at a web form trying to remember what it looked like yesterday. A registrar with a real API turns DNS into something you can script, version, and reason about.

Script the records

With programmatic DNS you set records from code, which means you can keep the intended state in the repository and apply it, rather than describing it in a wiki and hoping the dashboard matches.

# point a product subdomain at the host, from a script
porkbun dns-add codeamanilabs.org CNAME app target.host.example --ttl 600
porkbun dns-list codeamanilabs.org   # read back the live records

Reading the records back from the API is half the value: you can verify that what is live matches what you intended, automatically, instead of trusting that a manual edit took.

Watch out for split nameservers

The subtle failure that costs the most time is editing DNS in one place while the domain's nameservers point somewhere else. The records you added are real, but they are inert, because the resolvers are asking a different authority. This bit this very platform: email verification records sat ignored for days because they were added at the registrar while the domain was delegated to another provider's nameservers. Always confirm which nameservers are authoritative before deciding a record is "not working".

Short TTLs while you change things

Set a low time to live on records you are actively moving, so a mistake propagates out and a fix propagates in within minutes instead of a day. Raise the TTL again once things are stable. A long TTL on a record you are still tuning turns every correction into an hour of waiting.

Why it belongs in the stack

DNS is the foundation the brand sits on, and a brand portfolio of many product domains makes hand editing untenable. Scripting it is what lets you stand up a new product subdomain, verify it, and govern it the same way every time, which is the groundwork the domain portfolio strategy builds on.

Qualified conversation

Have a build to de-risk? Let's talk.

Tell us what you are building. We respond within two business days.