Hostname is used to display the system's DNS name, and to display or set its hostname or NIS domain name.
Hostname help you:
- recognize machine
- know when run commands against the machine
# to show the name of your computer hostname ---- master-node
Hostname
is stored in /etc/hostname
cat /etc/hostname ---- master-node
Hostname
need to be existed in /etc/hosts
as well.
Other commands
hostname -f # full name hostname -I # show the machine IP on the system
hostnamectl ---- Static hostname: master-node ...
Change hostname
sudo hostnamectl set-hostname <new-hostname> # update hosts sudo nano /etc/hosts ---- 127.0.0.1 localhost 127.0.1.1 <new-hostname> <shorten-version>
Leave a comment if you have any questions.
===========
Please keep in touch
Portfolio
Linkedin
Github
Youtube
Top comments (0)