The system we usually know is Microsoft's system, but Linux system and Unix system are also welcomed by some users. Since everyone is not familiar with these two operating systems, then today we will introduce you to the Unix system. Hosts file.
1. About /etc/host, hostname and IP configuration file
Hosts - The static table lookup for host name
Linux/Etc/hosts is a file that configures the ip address and its corresponding host name. Here you can record the ip of the local or other host and its corresponding host name. This configuration file may be different for different linux versions. For example, the corresponding file for Debian is /etc/hostname.
2. Configuration File
This file can be configured with the host ip and the corresponding host name. The role of the server type Linux system is not negligible. On a LAN or INTERNET, each host has an IP address that separates each host and can communicate based on ip. But the IP address is not convenient to remember, so there is a domain name. In a local area network, each machine has a host name that is used to distinguish hosts and facilitate mutual access.
The relevant configuration file for Linux hostname is /etc/hosts; this file tells the host which domain names correspond to those ips, and which hostnames correspond to ip:
For example, there is such a definition in the file.
192.168.1.100 linumu100 test100
Suppose 192.168.1.100 is a web server. Enter http://linumu100 or http://test100 in the web page to open the web page 192.168.1.100. .
Normally this file first records the ip and hostname of the machine:
127.0.0.1 localhost.localdomain localhost
3. Configuration File Format Description
The contents of the general /etc/hosts generally have the following contents:
127.0.0.1 localhost.localdomain localhost
192.168.1.100 linmu100.com linmu100
192.168. 1.120 ftpserver ftp120
In general, each host file is a host. Each line consists of three parts, each separated by a space. The line at the beginning of ## is used for explanation and is not explained by the system.
Part 1: Network IP Address;
Part 2: Host Name or Domain Name;
Part 3: Host Name Alias;
Of course, each line can also be two parts, namely the host IP address and host name; for example, 192.168.1.100 linmu100.
Here you can slightly explain the difference between the hostname (hostname) and the domain name (Domain): the hostname is usually used in the LAN, through the hosts file, the hostname is resolved to the corresponding ip; the domain name is usually on the internet Use, but if the machine does not want to use the domain name resolution on the internet, then you can change the hosts file and add your own domain name resolution.
How does PPT embed a web page? How to add a web page to PPT? I believe many users still dont know. I
What should I do if Baidus network disk fails to upload files? I believe many users have encountered
The win2008 system is the only one that is comparable to the security and stability of the 2003 syst
What is the process of ACS.exe? Many small partners found a process called ACS.exe in the process of
How to improve the security of the FTP server in an all-round way.
Which methods can make the battery extend 2 times usage
How to set Thunder as the default download software?
What issues should I pay special attention to when using a USB flash drive
Qq how to set up automatic reply?
Experts explain the things of the computer camera
Windows access to Linux shared files
View the current system apache version
How to solve the problem of network failure?
Solve the problem of not being able to access the network after reinstalling the system
Make Windows XP run more smoothly (3)
Win8.1 system English font rendering is not normal solution
Win10 system picture viewer full screen view and exit full screen mode
Windows 7 CD-ROM does not read the disk, automatically pops up the solution
Win8.1 update installation error Solve 0x80073712 error method
Win2003 ASP.NET - Configuration Inheritance
Win10 TH2 official version version has been set is win10 preview version 10586
Solve the problem that Windows can't open add/remove programs