Hostname and DNS servers play an important role in networking as a machine is reachable in a network either by the IP address or hostname. The DNS server is responsible for the IP address to domain name and domain name to IP address conversion. This process of conversion is also known as name resolution or DNS resolution.
Since CentOS 7, the static host name has been stored in a new file, /etc/hostname. In earlier versions, it was stored in the /etc/sysconfig/network file. Now, a new command has been introduced with the name hostnamectl, to view and modify the hostname of machine.