Answers: <p>Both are completely correct. It can differ organisation by organisation. 
  Also, once you start using one of the domain namespace type, you will gradually remember the format and no issues will come. However, I can see one issue here which is related to SSL. </p>
  
  <p>If you go with any one of the above mentioned namespaces, you need to generate multiple SSL certificates such as <code>*.api.superproduct.com</code> and <code>*.front-end.superproduct.com</code>.</p>
  
  <p>If you go with other namespace type then SSL certs will be required for <code>*.staging.superproduct.com</code>, <code>*.qa.superproduct.com</code> and <code>*.development.superproduct.com</code>.</p>
  
  <p>To avoid this, I would suggest you to have the domains in either of the following formats.</p>
  
  <ol>
  <li><code>&lt;component-name&gt;-&lt;env-name&gt;.superproduct.com</code></li>
  </ol>
  
  <p>Examples are:
  <code>api-qa.superproduct.com</code>, <code>api-staging.superproduct.com</code> etc.</p>
  
  <ol start="2">
  <li><code>&lt;env-name&gt;-&lt;component-name&gt;.superproduct.com</code></li>
  </ol>
  
  <p>Examples are:
  <code>qa-api.superproduct.com</code>, <code>staging-api.superproduct.com</code> etc.</p>
  
  <p>In this case, only one SSL certificate for <code>*.superproduct.com</code> will be required.</p>
  
  <p>You can go ahead with the best possible option as per your requirements and analysis.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-17T17:16:22.177Z
Answers: 2019-09-17T17:16:22.177Z
Answers: Samit
Body: <p>If we have two components in a API</p>
  
  <p><code>api</code> <code>front-end</code> </p>
  
  <p>and we have three environments <code>staging</code> <code>qa</code> <code>development</code></p>
  
  <p>and a domain name <code>superproduct.com</code></p>
  
  <p>What would be the most logical domain spacing:</p>
  
  <pre><code>http://development.front-end.superproduct.com
  http://development.api.superproduct.com
  
  http://qa.front-end.superproduct.com
  http://qa.api.superproduct.com
  
  http://staging.front-end.superproduct.com
  http://staging.api.superproduct.com
  </code></pre>
  
  <p>or the other way around:</p>
  
  <pre><code>http://front-end.development.superproduct.com
  http://api.development.superproduct.com
  
  http://front-end.qa.superproduct.com
  http://api.qa.superproduct.com
  
  http://front-end.staging.superproduct.com
  http://api.staging.superproduct.com
  </code></pre>
  
Tags: <dns>
Title: Sub-subdomain Domain name for different environment
UserDisplayName: David
ThreadText: # Sub-subdomain Domain name for different environment
  
  (Asked by: username_0 on 2019-09-16)
  
  If we have two components in a API
  
  `api` `front-end`
  
  and we have three environments `staging` `qa` `development`
  
  and a domain name `superproduct.com`
  
  What would be the most logical domain spacing:
  
  ```
  http://development.front-end.superproduct.com
  http://development.api.superproduct.com
  
  http://qa.front-end.superproduct.com
  http://qa.api.superproduct.com
  
  http://staging.front-end.superproduct.com
  http://staging.api.superproduct.com
  
  ```
  
  or the other way around:
  
  ```
  http://front-end.development.superproduct.com
  http://api.development.superproduct.com
  
  http://front-end.qa.superproduct.com
  http://api.qa.superproduct.com
  
  http://front-end.staging.superproduct.com
  http://api.staging.superproduct.com
  
  ```
  
  **Tags:** dns
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-17. Score: 3 | Accepted answer
  
  Both are completely correct. It can differ organisation by organisation.
  Also, once you start using one of the domain namespace type, you will gradually remember the format and no issues will come. However, I can see one issue here which is related to SSL.
  
  If you go with any one of the above mentioned namespaces, you need to generate multiple SSL certificates such as `*.api.superproduct.com` and `*.front-end.superproduct.com`.
  
  If you go with other namespace type then SSL certs will be required for `*.staging.superproduct.com`, `*.qa.superproduct.com` and `*.development.superproduct.com`.
  
  To avoid this, I would suggest you to have the domains in either of the following formats.
  
  1. `<component-name>-<env-name>.superproduct.com`
  
  Examples are:
  `api-qa.superproduct.com`, `api-staging.superproduct.com` etc.
  
  2. `<env-name>-<component-name>.superproduct.com`
  
  Examples are:
  `qa-api.superproduct.com`, `staging-api.superproduct.com` etc.
  
  In this case, only one SSL certificate for `*.superproduct.com` will be required.
  
  You can go ahead with the best possible option as per your requirements and analysis.
  
  
  ---
  
  