Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the best practice for domain names (dev, staging, production)?

With the rise of containers, Kuberenetes, 12 Factor etc, it has become easier to replicate an identical environment across dev, staging and production. However, what there appears to be no common standard to domain name conventions.

As far as I can see it, there are two ways of doing it:

  • Use subdomains:
    • *.dev.foobar.tld
    • *.staging.foobar.tld
    • *.foobar.tld
  • Use separate domains:
    • *.foobar-dev.tld
    • *.foobar-staging.tld
    • *.foobar.tld

I can see up and downs with both approaches, but I'm curious what the common practise is.

As a side-note, Cloudflare will not issue you certificates for sub-sub domains (e.g. *.stage.foobar.tld).

like image 702
vpetersson Avatar asked Sep 05 '16 18:09

vpetersson


People also ask

How do you name a subdomain?

Name your subdomain. First, think of a subdomain name that best fits the section of the site you're assigning. Common subdomains include blog, store, shop, support, help, and events. There's no need to overthink this — pick a name that succinctly describes this part of your site, and limit it to one word if you can.

What is a subdomain example?

To recap, a subdomain is the portion of a URL that comes before the “main” domain name and the domain extension. For example, docs.themeisle.com . Subdomains can help you divide your website into logical parts or create separate sites, for example a separate blog for each sports team.


1 Answers

There are only two hard things in Computer Science: cache invalidation and naming things.

-- Phil Karlton

Depends on the company size.

Small businesses usually go for dashes and get the wildcard certificate. So they would have dev.example.com, test.example.com

In larger enterprises they usually have a DNS infrastructure rolled out and the provisioning processes takes care of the assignment. It usually looks like

aws-eu-central-1.appName.staging.[teamName].example.com 

They would either use their own self-signed certs with the CA on all servers or have the money for the SANs.

For more inspiration:

https://blog.serverdensity.com/server-naming-conventions-and-best-practices/

https://mnx.io/blog/a-proper-server-naming-scheme/

https://namingschemes.com/

like image 128
Marcus Maxwell Avatar answered Oct 05 '22 00:10

Marcus Maxwell