"Linux learning is not difficult" Linux network configuration file (3):/etc/hosts file

Source: Internet
Author: User
Tags domain name server

26.3 "Linux Learning is not difficult " Linux network configuration file (3):/etc/hosts file


When the computer starts, the computer needs to query for some hostname-to-IP address matching before DNS can be queried. These matching information is stored in the/etc/hosts file. In the absence of a domain name server, all network programs on the system resolve the IP address corresponding to a host name by querying the file.
The following is an example of the contents of the/etc/hosts file.

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4:: 1 localhost localhost.localdomain Localhost6 localhost6.localdomain6 192.168.0.2 rhel.test.com rhel//Leftmost column is the computer IP address, the middle column is the host name, the rightmost column is the alias of the host



This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .



"Linux learning is not difficult" Linux network configuration file (3):/etc/hosts file

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.