Get the most out of your Centmin Mod LEMP stack
Become a Member

Domains DNS Ideal hostname naming convention

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Mari2000, Dec 22, 2020.

  1. Mari2000

    Mari2000 Premium Member Premium Member

    6
    1
    3
    Jul 12, 2020
    Ratings:
    +2
    Local Time:
    4:50 AM
    I have an existing xenforo forum (www.forum.com) and planning to migrate it to a centos with cmm. I'm in the process of testing on build no. 1.

    I know this is minor, but at 2am I'm stuck. I can see from the getting started guide there are concerns with naming convention for hostnames and DNS A records (i.e. can't use forum.com). The directions in section 1 talk about "Your default server hostname is usually the hostname used to purchase the VPS or dedicated server in the first place. It's basically a subdomain that links your order so would usually be something like hostname.newdomain.com where subdomain = hostname"...

    but with digital ocean you just create new VMs and give a "name" on the outside, that eventually becomes the short and long hostname name inside.

    So here is my confusion, in my initial test build, the hostname is 'main' and no version of main.forum.com appears inside via all the commands like: (uname -a, hostname, hostnamectl status --static, uname -f, uname -m, hostname -s, hostname -f).

    But, I see it seems from the reading there is a preference to have some form of the long version (main.forum.com, or www.forum.com, or forum.com) appear in some of these hostname outputs, and have proper A records for them.

    But my hangup is it doesn't seem consistent in the reading. This youtube video only has the short hostname version, but other helpful posts and guides show long form, but other helpful posts and guides show long form in some places.



    What is the consensus for an ideal approach? For educational purposes, does it matter if I plan someday to insert cloudflare later? And does planning to add/park other domains later like 'blog.NEWsite.com' change it the ideal recommendation?

    edit: I guess another way to ask this question... from the guide...

    If the hostname returned from uname -n command does not match the hostname you used to place your order for your server, then you can get your web host to correct it for you or do it yourself as follows:

    And

    Change HOSTNAME variable to your desired hostname. It has to be a valid hostname in format of hostname.newdomain.com

    Why is long form necessary for uname -n output? (Digital Ocean simply places the outside label you originally pick as both short and long form inside).
     
    Last edited: Dec 22, 2020
  2. eva2000

    eva2000 Administrator Staff Member

    46,649
    10,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,435
    Local Time:
    7:50 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah generally when I refer to main hostname, it's the long format as outlined in Getting Started Guide step 1 at Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS

    The name isn't that important and won't affect any actual domains you use/park in future. But identification purposes I usually have some shortform that relates to the web host I am using.
     
  3. Mari2000

    Mari2000 Premium Member Premium Member

    6
    1
    3
    Jul 12, 2020
    Ratings:
    +2
    Local Time:
    4:50 AM
    If I go into production with only short form hostname, is there any gotchas with CMM to be aware?

    By the way, what is your convention for each new domain you standup?

    example:
    website: www.centminmod.com (with A record)
    hostname short form: main (with A record)
    hostname long form: main.centminmod.com (with A record)
     
  4. eva2000

    eva2000 Administrator Staff Member

    46,649
    10,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,435
    Local Time:
    7:50 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    sorry for confusion - by shortform i mean like if using web host named mywebhost, then hostname might be something like host-mwh-001.domain.com

    if web host was vpshosting, then would be like host-vh-001.domain.com

    so it's a mix to identify web host and the server

    it doesn't even have to be same domain as your normal domains so could be host-vh-001.someotherdomain.com