I have a CentOS 7 install that is giving me some weird returns when I lookup the hostname of the localmachine. I am used to working with Windows and the hosts file (/etc/hosts in CentOS) so feel like I have this setup correct. I do have a few entries in the hosts file as I am running a group of virtual machines for a test deployment scenario - Hence the extra names defined in there. All the machines in the deployment (3) have the same setup and are returning essentially the same data.admin@node2$ hostnamenode2.deployment.localadmin@node2$ hostname -fchef-node2admin@node2$ cat /etc/hosts127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4::1         localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.5.99 node1 node1.deployment.local192.168.5.100 master master.deployment.local192.168.5.98 node2 node2.deployment.localadmin@node2$ printenv | grep -i -e hostnameHOSTNAME=node2.deployment.localadmin@node2$ cat /etc/environmenthttp_proxy=http://stupidproxy.itsaywehavetohaveit.local:3128https_proxy=http://stupidproxy.itsaywehavetohaveit.local:3128java_home=/applications/jre1.8.0_92/DISPLAY=127.0.0.1:0.0What I am trying to figure out is why the system prints the netbios name when running the 'hostname -f' command and prints the FQDN when I run the 'hostname' command. I believe that this is causing me some issue.Your help understanding and hopefully resolving this is appreciated.
CentOS 7 hostname netbios/fqdn output
centos;dns;hostname
swap the hosts in your /etc/hosts, the format should be long then short.good:176.31.91.220 www.mikejonesey.co.uk mikebad:176.31.91.220 mike www.mikejonesey.co.ukhostname will work off this, also I on epel systems i tend to change the domain in /etc/sysconfig/network to be just the hostname, then add the extra def for domain.