Centos and Windows achieve mutual access through the host name

1. Business needs

        In the intranet environment, we want to directly access our server through a specific host name, without having to memorize the IP address of the server, and do not want to operate through proxy tools such as nginx or domain name configuration content.

2. Analysis

        Usually we can directly enter [localhost] in the browser and press the Enter key to access the content of port 80 of our host; then can we change this localhost to several names we want to realize the local area network? How about multiple servers accessed by the whole name? In this way, we save the problem of remembering the ip address, and it is more convenient to remember through the name.

3. Implementation method

3.1. Obtain the IP addresses of Centos and Windows systems respectively

① Obtain the IP address command of the Centos system server:

ifconfig

② Obtain the IP address command of the Windows system server:

ipconfig

 ③Set a meaningful host name according to the obtained IP address. For example, the host name here is as follows:

Guess you like

Origin blog.csdn.net/xiaochenXIHUA/article/details/130693467