Modify/etc/hosts in Linux

Source: Internet
Author: User
Hosts file hosts -- the static table lookup for host name (host name query static table) hosts file is a file on the Linux System for fast resolution of IP addresses and domain names, save it in the/etc/directory in ASCII format. The hosts file contains the ing between the IP address and the host name, as well as the host alias. All networks on the system without a domain name resolution Server ProgramYou can query the file to parse the IP address corresponding to a host name. Otherwise, you need to use the DNS service program. You can map common domain names and IP addresses to the hosts file to achieve quick and convenient access priority: you can configure the Host IP address and the corresponding host name in the hosts format of DNS Cache> hosts> DNS service. On a LAN or the World Wide Web, each host has an IP address that separates each host and can communicate with each other based on its IP address. However, the IP address does not conform to the memory rules of the human brain, so domain names such as www.baidu.com. in a LAN, each machine has a host name, which is used to distinguish hosts for mutual access. hosts file format
IP address host name/domain name (host alias)

Host Name and domain name difference host name is usually used in the LAN, through the hosts file, the host name is resolved to the corresponding IP address; the domain name is usually used on the Internet, but the priority is lower than the content in the hosts file, therefore, if you do not want to use domain name resolution on the Internet, you can change your hosts file and add your own domain name resolution hosts file. One of the main functions of this file is to simulate the offline environment, to access each other through a domain name on the Internet in the same LAN, you only need to modify the content of your/etc/hosts file to modify the hosts file and Ping www. baidu. con results are as follows: References http://soft.zdnet.com.cn/software_zone/2007/0831/481970.shtml

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.