Give every environment an unmistakable name

A production hostname is the address visitors are meant to use, such as www.example.com. Development and staging hostnames serve different purposes: development is a place to build and experiment, while staging is commonly used to check a nearly finished change before release. Their names should make those roles obvious to anyone reading a browser tab, DNS record, deployment setting, or support message.

A consistent pattern helps. For example, dev.example.com and staging.example.com are easier to distinguish from www.example.com than a collection of abbreviations known only to the person who created them. If several teams or projects need separate spaces, add a meaningful project identifier, such as staging-shop.example.com. Keep the pattern short enough to read and document who owns each hostname. Avoid reusing an old staging name for a different project without first checking what still points to it.

Treat a DNS record as a pointer, not an environment boundary

DNS connects a hostname to a destination, but it does not make that destination safe for a particular purpose. A staging A or AAAA record may point directly to a server address; a CNAME may point to a hosting provider’s assigned name. Either approach can work if it matches the provider’s instructions. Before creating a record, confirm that the destination is the intended non-production service, then check that the web server or hosting platform is configured to answer for that hostname.

Keep a small inventory of hostnames, record types, destinations, owners, and intended uses. This makes it easier to spot a staging name that accidentally points at production or a retired development name that still resolves. Be cautious with wildcard records: a record for *.example.com can make mistyped or unplanned names resolve, which may hide mistakes. If a wildcard is useful, understand how it interacts with explicitly configured hostnames and the application that receives their requests.

Separate application behavior as well as addresses

Different DNS names do not automatically mean different data or settings. Check where each environment connects for its database, file storage, background jobs, analytics, and outgoing email. A staging site that uses production data or sends real customer messages can cause problems even when its hostname is perfectly labeled. Use non-production resources where practical, and review any necessary exceptions deliberately.

Make the environment visible inside the site. A persistent staging banner or clearly different page title can prevent someone from editing the wrong place. Check canonical URLs, redirects, and links in generated emails: a staging page should not silently send testers to production, and production should not direct visitors to staging. Cookies also deserve attention. A cookie scoped broadly to example.com may be shared across subdomains; environment-specific cookie settings can reduce confusing sign-in behavior.

Limit unintended access and exposure

A hostname does not become private because it is called dev or staging. If a non-production site is reachable from the internet, people may encounter it. Use suitable access controls, such as authentication or a network restriction, when its contents should be limited to testers. Keep those controls separate from any instruction to search engines not to index the site; an indexing preference is not an access barrier.

Plan HTTPS for each hostname that people will visit. The certificate must cover the name being used, and the service must present it correctly. If testers see a certificate warning, investigate rather than treating it as normal for staging. Remove sensitive sample content before granting access, and do not put passwords, tokens, or other secrets in hostnames, DNS records, or shared screenshots. When a temporary environment is no longer needed, remove both its DNS entry and its application configuration so the old name cannot lead somewhere unexpected.

Use a repeatable check before changes go live

Before changing a hostname, write down the expected result: which name should resolve, where it should lead, and what a visitor should see. After the DNS change, check the record, open the hostname over HTTPS, and verify the page’s environment label, redirects, links, and access controls. DNS responses can remain cached for a time, so a change may not appear everywhere at once. If results differ, compare the DNS answer with the hosting configuration before making another change.

Promotion to production should be a deliberate application or deployment step, not a casual swap of similar-looking DNS values. Have someone review changes to production names when possible, and keep a way to restore the previous working configuration. Clear names, an accurate inventory, and a short verification routine make development and staging useful testing spaces without letting them blur into the site visitors rely on.

Back to category ↗