Launching a Subdomain, From Zero to Live

Adding a subdomain is usually a five-minute job in a DNS panel. Getting it right, so that it resolves everywhere, has a valid certificate, does not break anything else in the zone and will not become a security problem in two years' time, takes a little more thought. This guide walks through the complete sequence for one new subdomain, using app.example.com as the example. The reserved documentation domain and IP ranges are used throughout; substitute your own values.

Step 1: Decide what the subdomain points at

Everything else follows from this. There are two common situations:

The comparison of CNAME and A records covers the trade-offs in detail.

Step 2: Know the CNAME rules

CNAME records come with restrictions that catch people out:

Step 3: Choose a TTL

The time to live (TTL) tells resolvers how many seconds they may cache your answer. A short TTL means changes are picked up quickly but generates more queries; a long TTL is efficient but makes changes slow to spread. For a brand-new record a moderate TTL, such as an hour, is a sensible default. If you expect to change the record soon, for instance during a migration, a shorter TTL for the first few days makes corrections faster. See TTL do's and don'ts.

Step 4: Add the records

For a subdomain on your own server, the records might look like this:

TypeNameValueTTL
Aapp192.0.2.103600
AAAAapp2001:db8::103600

For a hosted service, a single CNAME:

TypeNameValueTTL
CNAMEappshops.provider.example.3600

Most panels expect only the label (app) in the name field and add the domain for you. Some want the full name. If you enter app.example.com in a panel that appends the domain, you may accidentally create app.example.com.example.com. The trailing dot on the CNAME value marks it as a fully qualified name; panels differ on whether you need to type it. The visual tutorial mapping a DNS panel to a zone file shows the difference.

Only add an AAAA record if the server really answers on that IPv6 address. A wrong AAAA record can make the site fail for visitors whose networks prefer IPv6. See IPv6 and AAAA records.

Step 5: Verify, first at the source

Do not rely on loading the site in a browser, which may be using a cached answer. Ask the authoritative name servers directly, then a public resolver. With dig:

  1. Find the authoritative servers: dig NS example.com +short.
  2. Query one of them directly: dig @ns1.provider.example app.example.com A. If the answer is wrong here, the problem is in your zone, not in propagation.
  3. Query a public resolver: dig @9.9.9.9 app.example.com A or another resolver you trust. If the authoritative answer is right but this is not, you are waiting on caches, which the TTL of any previous answer governs.

On systems without dig, nslookup app.example.com ns1.provider.example does the same job. The dig tips and the guide to propagation without the myths go further.

Step 6: Issue a certificate

Browsers expect HTTPS on every site, so the subdomain needs a certificate covering its name. With an ACME certificate authority such as Let's Encrypt, the common validation methods are:

Hosted services usually issue the certificate for you once the CNAME is in place and you have added the domain in their dashboard. If you publish a CAA record for your domain, make sure it allows the authority that will issue for the subdomain. See wildcard certificates with DNS-01 and CAA records.

Step 7: Test the whole path

Once DNS and the certificate are in place, test from outside your own network if you can: load the site over HTTPS, check that the certificate covers the exact name, and confirm that any redirects, for example from HTTP to HTTPS, behave as intended. The self-check for subdomains that are not working lists the usual culprits.

Step 8: Record who owns it

The final step is the one most often skipped. Write down in a shared register what the subdomain is for, who requested it, which service it points at and when it should be reviewed. That single line is what prevents a forgotten record from becoming a takeover risk later, as explained in preventing subdomain takeover. The subdomain register guide and the launch checklist turn this into routine.

The Learn hub groups every guide by stage of a subdomain's life.

← Back to Home