In /etc/hostname, I have myname.
In /etc/hosts, I have :
127.0.0.1 localhost.localdomain localhost myname
::1 localhost.localdomain localhost myname
I have a vague understanding of what really is a hostname and what it is used for.
These more precise questions could help me to understand it better:
What really is my hostname in the example above?
mynameor something else? If I had insteadmyname.domain.comin/etc/hostname, what would be my real hostname then?In the example, the command
hostnamereturnsmyname, whereas the commandhostname -freturnslocalhost.localdomain. I had in mind that/etc/hostswas only a mapping between names and ip addresses. It seems to serve another function here. What is a fqdn and what is it used for? How is it retrieved? Why is itlocalhost.localdomain?If I had instead
myname.domain.comin/etc/hostname,hostname -fwould returnmyname.domain.com. Why?Why aren't fqdn ending with a dot in these files?
Are
hostname -danddnsmydomainequivalent?In what context can I use my hostname (
myname) and when do I have to use my fqdn (localhost.localdomain)?
Aucun commentaire:
Enregistrer un commentaire