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