Bind the ip address and host name in Linux.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.