Is it OK to have a diferent hostname to fqdn?
- by Cameron Ball
I have a server with fqdn git.mydomain.com (this is in DNS) but I don't really want the machine to have git as its hostname. Right now I have the hostname in /etc/hostname set as (for example):
mycustomhostname
And in /etc/hosts I have
1.2.3.4 git.mydomain.com mycustomhostname
(Where 1.2.3.4 is my server's IP)
I've read that the first component of the FQDN should always be the unqualified hostname, so is what I'm doing bad?
If so, what is the correct way to do what I want?