What is the hosts file?

- Privacy





Overview
The hosts file is a plain text file stored in your operating system that is used to map website names to IP addresses. When you enter a website address in your browser, your computer first checks the hosts file to see if there is a corresponding IP address. If there is, it connects directly to that IP address without needing to query a DNS server. If there isn't, it continues to query the DNS server to get the IP address and connect to the website.
Initially, the hosts file was used to solve the correspondence between hostnames and IP addresses on a network. However, it has also been used to block some advertisements and malicious websites. By adding specific entries in the hosts file, you can make your computer think that the IP addresses of those websites are invalid, effectively blocking their access.
Contents
How to use the hosts file to block ads and malicious websites?
How to ensure secure online browsing with MetroVPN?
How to use the hosts file to block ads and malicious websites?
Blocking ads and malicious websites using the hosts file is a straightforward process with the following steps:
① Open and edit the hosts file
Locate and open the hosts file using a text editor, such as Notepad, running with administrative privileges to edit the hosts file.
② Add specific entries or use public blocking lists
You can write down the names of the websites you want to block in the hosts file, along with an invalid IP address like 0.0.0.0. This way, when you attempt to visit these websites, your requests will be intercepted. For example, if you want to block http://facebook.com , you can add this line in the hosts file: 0.0.0.0 http://facebook.com
③ Copy public blocking lists
You can also use public lists that have collected harmful website URLs, such as Steven Black's hosts list1. These lists are regularly updated and offer different blocking options, such as ads, social media, adult content, gambling, etc. You only need to download and copy one of these lists into your hosts file.
④ Save and close the hosts file
After making the changes, save the hosts file and close it. This completes the setup to block ads and malicious websites. If you want to restore access to certain websites, you can simply delete or comment out the corresponding entries.
Using the hosts file to block ads and malicious websites has some advantages, such as improving browsing speed, saving bandwidth, and enhancing privacy. However, it also has some drawbacks, such as the potential to affect normal services, requiring manual updates and maintenance, and lack of support for wildcards.
How to ensure secure online browsing with MetroVPN?
While using the hosts file can block some ads and malicious websites, it cannot guarantee your online security and privacy. When you access other websites, you may still be exposed to monitoring or interference by third parties or your ISP. To better protect your online security and privacy, you can use a Virtual Private Network (VPN).
A VPN is software that encrypts all incoming and outgoing traffic on your device and routes it through an intermediary server. For example, by choosing a VPN service that offers UK servers, you can make it appear as if you are in the UK.
MetroVPN is a professional VPN service provider that can help you obtain a UK IP address. Here are some advantages of MetroVPN :
① Strict no-logs policy
MetroVPN adheres to a strict no-logs policy, meaning they do not track or store any of your online activities, ensuring your data remains confidential.
② Ultra-fast speed
MetroVPN provides high-speed servers, ensuring a smooth and seamless browsing experience without compromising performance.
③ Access restricted content
By connecting to MetroVPN 's 6500+ servers, you can bypass geographical restrictions and access content that may be blocked or unavailable in your region.
④ Multi-platform
MetroVPN is compatible with various devices and operating systems, including iOS, Android, macOS, and Windows, allowing you to protect your online activities across multiple platforms.
⑤ 30-day money-back guarantee
MetroVPN offers a risk-free trial period with a 30-day money-back guarantee, allowing you to try their service with peace of mind.
⑥ 24/7 customer support
MetroVPN provides round-the-clock customer support to assist you whenever you need help or have any questions.