Network Domain Name Linux. Host name is generally put in the etchostname file. How to display hostname Hostname is a pre-installed command in every Linux distribution.
Host name is the identifier of a system in the network. By default the system gets the address of the DNS server automatically by DHCP when you connect to the network. A hostname show or set the systems host name b domainname show or set the systems NISYP domain name c dnsdomainname show the systems DNS domain name.
From its manual page hostname is used to display the systems DNS name and to display or set its hostname or NIS domain name.
For this purpose the DNS servers that contain mappings of ip addresses to their domain names. Both Linux UNIX comes with the following utilities to display hostname domain name. This article explains how to setup a local DNS using the hosts file etchosts in Linux systems for local domain resolution or testing the website before taking live. How to setup FQDN in Linux.