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
hostname
in debian OS ssh) different from Hostname that you type in DNS serverA
Record?Is it normal to have my Debian Machine hostname set as
maximus
and 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
host
part, 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
hostname
returns what you have configured the system to consider to be its hostname. There may be any number ofA
/AAAA
records pointing to IP addresses associated with this system.That in itself is not abnormal. I would, however, expect an
A
/AAAA
record for the name beginning withmaximus
as 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.com
to be its FQDN, there is an expectation that this name exists in DNS as well (possibly in addition to many other names).hostname
returns what you have configured the system to consider its hostname (egmaximus
).hostname -f
will return the former with the domain appended, forming the FQDN (egmaximus.example.com
). The domain is often based on an entry in thehosts
file. Thehost
command, if that is what you refer to, is a DNS-only tool.
No comments:
Post a Comment