Edit Domain Name Linux. In the networking terminology the domain name is the mapping of IP with the name. Sudo nano etchostname sudo nano etchosts.
Edit Your etchostname File Open a terminal window to get started. We will set the hostname as ubu1 with the following echo command. Domainname command in Linux is used to return the Network Information System NIS domain name of the hostYou can use hostname -d command as well to get the host domainnameIf the domain name is not set up in your host then the response will be none.
However the hosts file provides an alternative method to map hostnames to IP addresses.
This is also known as the YPNIS domain name of the system. You can change it. Nameserver receives hostname or domain name in the query and responds back with IP address. And restart hostname service.