Linux host name

Source: Internet
Author: User
Linux host name (hostname)-Linux Enterprise Application-Linux server application information. For more information, see the following section. Author: North South
From: LinuxSir. Org
Abstract: This document is about the Linux host name (hostname). It briefly describes the main configuration file/etc/hosts; in addition, the hostname tool of the basic configuration tool is also provided as an example. You are welcome to give an axe. Thank you;

Directory

1. What is a host name;
2. Host Name configuration file;

2.1 host name configuration file/etc/hosts explanation;
2.2 differences between host names and Domain names;
2.3 The reason why machines on the LAN cannot access each other through host names;

3. Host Name modification tool hostname;
4. Matters not covered in this article;
5. About this article;

++
Body
++

1. What is a host name;

Each host has an IP address, whether on the LAN or the INTERNET, to distinguish between the host and the other host, that is, the IP address is the house number of the host. But the IP address is not easy to remember, so there is a domain name. The domain name only exists in the INtERNET (except for the LAN experiment for the purpose of the experiment). Each domain name corresponds to one IP address, but one IP Address can correspond to multiple domain names. Domain Name types such as linuxsir.org;

What is the host name used? In a LAN, each machine has a host name for easy distinction between the host and the host, you can set a host name for each machine, to facilitate mutual access in a way that is easy to remember. For example, we can name each machine based on its functions in the LAN.

Configuration file related to the Host Name:/etc/hosts;

2. Host Name configuration file;

Most of the Host Name configuration files are/etc/hosts;

Hosts-The static table lookup for host name (host name query static table );

Due to the large number of Linux releases, configuration files related to host names are sometimes different. Now let's talk about the common version of the Host Name configuration file;

2.1 host name configuration file/etc/hosts explanation;

Ora/Redhat or a release package based on Fedora/Redhat. The host name configuration file is/etc/hosts.
Debian or Debian-based release. The host name configuration file is/etc/hostname and/etc/hosts.
The Slackware host name configuration file is/etc/hosts.

Let's read the content of/etc/hosts and see what this file is used. The hosts configuration file is used to map host names to IP addresses. This method is relatively simple. However, this ing is only the ing of local machines. That is to say, each machine is independent and all computers cannot access each other through hostname.

Note: there is also a/etc/hostname File In debian. This file writes the local host name directly, but it must be consistent with the local host name in/etc/hosts.

The content of/etc/hosts is generally similar to the following:
QUOTE:

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.