Solve the problem of hostname changing Bogon under Linux

Source: Internet
Author: User

Wake up in the morning find the Linux hostname changed to Bogon

Bogon refers to addresses that should not appear in the Internet routing table.
These addresses should include:
1, private address such as 10,172.16-32,192.168 .....
2. Address not officially assigned

After Google found a way to change the name

One: Using the hostname command
[Email protected] ~]# hostname yourname
This only changes the host name temporarily.
Two: Modify the Linux host configuration files/etc/sysconfig/network and/etc/hosts
1. Modify the host name inside the/etc/sysconfig/network.
# vi/etc/sysconfig/network
Networking=yes
Hostname=yourname//Modify HOSTNAME in this
gateway=192.168.1.1//Your IP address
2. Modify the name inside the/etc/hosts
# vi/etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.121 yourname//In this change hostname//Your IP address
Sometimes this is the only line.
127.0.0.1 yourname localhost.localdomain localhost
3. Make the name of the change effective without restarting the machine
# hostname Yourname
# su

Solve the problem of hostname changing Bogon under Linux

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.