This might sound stupid and basic to some of you, but I am still so confused about this even after reading numerous sources on the net. My questions still unclear are:
Is the Hostname in machine (for example when typing
hostnamein debian OS ssh) different from Hostname that you type in DNS serverARecord?Is it normal to have my Debian Machine hostname set as
maximusand have the DNS A Record Hostname set asmail?Are these 2 the same that I am confused thinking of them as separate or are they usually used in interchangeable term causing the confusion?
When it comes to FQDN, for the
hostpart, does it use the hostname of the machine or the hostname given in the DNS A record?
My setup: 1 Debian 7 VPS with web server and mail server both on the same box.
Answer
hostnamereturns what you have configured the system to consider to be its hostname. There may be any number ofA/AAAArecords pointing to IP addresses associated with this system.That in itself is not abnormal. I would, however, expect an
A/AAAArecord for the name beginning withmaximusas well, as that appears to be the canonical name in your example.These are not conceptually the same but the expectation is that there is an overlap. Ie, if you have configured the system to consider
maximus.example.comto be its FQDN, there is an expectation that this name exists in DNS as well (possibly in addition to many other names).hostnamereturns what you have configured the system to consider its hostname (egmaximus).hostname -fwill return the former with the domain appended, forming the FQDN (egmaximus.example.com). The domain is often based on an entry in thehostsfile. Thehostcommand, if that is what you refer to, is a DNS-only tool.
No comments:
Post a Comment