I have 2 VPSs running using Centos 7. When I look up at the /etc/hosts file:
I found the entry of the host file for VPS 1 like this:
127.0.0.1 localhost.localdomain localhost
But then the entry of host file for VPS 2 is like this:
127.0.0.1 localhost localhost.localdomain
I'm not sure why the 2 entries are different. My question is, what is the correct syntax for declaring this Fully Qualified Domain Name in your host file? Are those 2 lines can be used and has the same purpose?
About the mark as duplicated answer, for explanation: The question asked there specifically about RHEL-based and Debian-based distros that have difference host setting but this question is about the same distro (CentOS 7) but has different host setting that might confuse some questioners to get the 'why' answer where the answer from the reference doesn't cover this.