Bind the ip address and host name in Linux.
1: Enter the command gedit/etc/hosts
In this way, you open a text and add the following content at the end of the text:
IP address Host Name
192.168.0.125 hadoop
Save and exit.
How to resolve a linux host name to a valid IP Address
/Etc/sysconfig/network
The file is the host name on the network.
/Etc/hosts
The file is the domain name or name corresponding to the IP address.
Does the linux host name automatically change to an IP address? Without any settings, how can I avoid changes?
I used to encounter this situation. Later I found that the host name was set for the NIC. When I restarted, I read the NIC configuration again. View the eth0 or eht1 configuration, which should be written in. /Etc/sysconfig/network-stript/eth0 or eth1
In addition, if your IP address is automatically allocated by DHCP, the name may also be automatically allocated by DHCP.
For other modification methods, refer to my friends on the first floor.