In Linux, how does one modify the host name? in Linux, how does one modify the host name?

Source: Internet
Author: User

In Linux, how does one modify the host name? in Linux, how does one modify the host name?

Step 1:
Host name after modification
Step 2:
Modify the hostname in/etc/sysconfig/network
Step 3:
Modify the/etc/hosts file

 

Example:

The current host name of my machine is pc. to change it to target_pc:

1: Use the hostname command

2: Modify the/etc/sysconfig/network File

3: Modify the hostname in the/etc/hosts file

4: reboot


-- This article reference from the computer boutique tutorial Network: http://www.ititgo.cn


How can I change the linux host name?

Many people use the hostname to modify the host name. In fact, this is only for the moment. After restarting, it will be restored to the original name.

Many people say that the host name in the/etc/hosts file is only provided for dns resolution. if you cannot use dns, you only need to modify the host name.

In fact, it is to modify the host name in the file etc/sysconfig/network.

NETWORKING = yes
HOSTNAME = Host Name

------------------------------------------------------------------------

Remember to restart !!!

------------------------------------------------------------------------

Complete:

Step 1:
# Hostname oratest
Step 2:
Modify the hostname in/etc/sysconfig/network
Step 3:
Modify the/etc/hosts file
Www.ititgo.com
Reference: www.ititgo.cn/news_view.asp? Newsid= 562

How can I change the linux host name?

Many people use the hostname to modify the host name. In fact, this is only for the moment. After restarting, it will be restored to the original name.

Many people say that the host name in the/etc/hosts file is only provided for dns resolution. if you cannot use dns, you only need to modify the host name.

In fact, it is to modify the host name in the file etc/sysconfig/network.

NETWORKING = yes
HOSTNAME = Host Name

------------------------------------------------------------------------

Remember to restart !!!

------------------------------------------------------------------------

Complete:

Step 1:
# Hostname oratest
Step 2:
Modify the hostname in/etc/sysconfig/network
Step 3:
Modify the/etc/hosts file
Www.ititgo.com
Reference: www.ititgo.cn/news_view.asp? Newsid= 562

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.