Is it OK to have a diferent hostname to fqdn?

Posted by Cameron Ball on Server Fault See other posts from Server Fault or by Cameron Ball
Published on 2012-11-29T03:46:38Z Indexed on 2012/11/29 5:06 UTC
Read the original article Hit count: 138

Filed under:
|

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?

© Server Fault or respective owner

Related posts about hostname

Related posts about domain-name