Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure hosts file in virtual host

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to configure the hosts file in the virtual host, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The hosts file is an address book located on the local desktop that maps hostnames to IP addresses (network name resolution). Typically, domain names (hostnames) are converted to IP addresses through the DNS resolution process. However, host entries that exist in this file will bypass this DNS resolution.

Create a hosts file

To see the results immediately, you can define the host / domain name in the hosts file. You may also need to refresh the DNS. The IP address of the Web site may be saved in the computer's cache. Therefore, you need to clear this temporary data so that the IP address of the host file you just entered takes effect.

Windows system

1. Click the start menu. Go to attachments and click Command prompt.

2. Run the following command: C:\ > ipconfig / flushdns

Linux system

1. Log in to the server. Run the following command:

Root@support [~] # cd / etc/rc.d/init.d

Root@support [/ etc/rc.d/init.d] #. / nscd restart

If you open any browsers, please close them and then open them. You should now be able to successfully test the site on the new server.

The above content is how to configure the hosts file in the virtual host. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report