hostname and Domainname

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
36
Location
The Netherlands
I found on the forum that you cannot use domain as hostname and its recommended to use svr1.domain.com
I am using this setup but i like to add svr1.domain.com to the admin users as domain so i can custom config to httpd (mod rewrite proxy etc.)
Voor tools that run on the server webside. I can ofc make them manually in the custom dir but having directadmin setup the basic templates is quite usefull.
Besides I like to know the reason.

So is this a no no (i gues) but why ?
What is the prefered way to access monitors custome interfaces run on the server in this example shellinabox.
 

ikkeben

Verified User
Joined
May 22, 2014
Messages
641
Location
Netherlands Germany
I Guess the why is:
That changes for that domain / virtualhost then also could have influence on other services needed by the server/hostname.

For simple example to explain if you you for that domainname admin user in DA GUI a letsencyrypt cert then all other parts as in the hostname letsencrypt script are failing. ( then problems a lot )
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
575
Location
Murfreesboro
I may not follow you totally. "srv1" is not a sub domain its a Hostname. Although you could be thinking of something else.
Your server should have a FDQN. Which is made up of host name and domain name.

All server need names like cats and dogs...

brent.cooldomain.com

Host name = brent
Domain name = cooldomain.com
FQQN = brent.cooldomain.com

Code:
hostnamectl status
gives
Static hostname: brent.cooldomain.com

Code:
hostnamectl -h
hostnamectl [OPTIONS...] COMMAND ...

Query or change system hostname.

  -h --help              Show this help
     --version           Show package version
     --no-ask-password   Do not prompt for password
  -H --host=[USER@]HOST  Operate on remote host
  -M --machine=CONTAINER Operate on local container
     --transient         Only set transient hostname
     --static            Only set static hostname
     --pretty            Only set pretty hostname

Commands:
  status                 Show current hostname settings
  set-hostname NAME      Set system hostname
  set-icon-name NAME     Set icon name for host
  set-chassis NAME       Set chassis type for host
  set-deployment NAME    Set deployment environment for host
  set-location NAME      Set location for host
Code:
cat /etc/hosts
gives
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
Your IP here brent.cooldomain.com brent
 

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
36
Location
The Netherlands
Ok so in my case it would be:

Host name = vps
Domain name = cooldomain.nl
FQQN = vps.cooldomain.nl

I have set hostname to vps.cooldomain.nl
So hostname is not that its actualy only vps.

[root@vps /]# hostnamectl status
Static hostname: vps.cooldomain.nl
Icon name: computer-vm
Chassis: vm
Machine ID: 353563dtshgrfth6545746453t5erge
Boot ID: 4235435tjjytjt35653ywrehhu57u5
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1062.4.1.el7.x86_64
Architecture: x86-64

Zo mij host name is wrong then?

But still why would you not use vps.cooldomain.nl as a website in DA ?
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
575
Location
Murfreesboro
Ok so currently your FDQN is vps.cooldomain.nl
This is your server. You should have this listed in you servers hosts file
Code:
cat /etc/hosts
like:
Your IP here vps.cooldomain.nl vps

Your website is usually www.cooldomain.nl
Right?

If you want a subdomain use the subdomain management tool to create.
Something meaningful like "mycoolsubdomainname" as long as it's not "vps".

But still why would you not use vps.cooldomain.nl as a website in DA ?
"vps" is your servers name it's not a subdomain. Is this helping?

Kind of like your name is "spacecabbie". If we created another user here on the forum called "spacecabbie" . We would all be confused wondering who to speak too.
 
Last edited:
Top