linux The role of the host file in
The hosts file is a file in the Linux system responsible for rapid resolution of IP addresses and domain names. It is saved in "ASCII format" /etc" directory, the file name is "hosts" (different Linux versions, this configuration file may also be different. For example, the corresponding file for Debian is /etc/hostname). The hosts file contains the mapping between IP addresses and host names, as well as aliases for the host names. In the absence of a domain name server, all network programs on the system query the file to resolve the IP address corresponding to a certain host name. Otherwise, a DNS service program needs to be used to solve the problem. Usually, commonly used domain names and IP address mappings can be added to the hosts file to achieve quick and convenient access. Host command application example in Linux
One command syntax
query the IP of a certain host.
2 Application examples
The above is the detailed content of The role of the host file and some commands in linux. For more information, please follow other related articles on the PHP Chinese website!