Advertising is a source of revenue for the Website, but sometimes popup ads (showing another window) or ads with nonsense content still annoy you. Normally, if you want to block ads, you will install Adblock or Adguard, but that will accidentally block ads that are useful and suitable for you. If you still want to support websites with good content with clean ads and do not want to display ads with unsightly pop-up windows, you can block POPUP ads using the hosts file.
Join the channel Telegram belong to AnonyViet 👉 Link 👈 |
You can also way Block ads on Spotify Similarly with the hosts file.
What is File Hosts?
The hosts file is a plain text file that contains a list of names host server and IP address respectively. This is essentially a database of domain names used by the operating system to determine the IP address of the server in a network environment.
The structure of the hosts file will be:
IPÂ Â Â Server
For example:
8.8.8.8 google.com
So your computer will understand that google.com has IP 8.8.8.8. When you use a browser to access Google, the browser will query IP 8.8.8.8 to display the website for you.
So to use the hosts file to block POPUP ads, you will redirect the addresses of the advertising links pointing to the IP 127.0.0.1
(This is the loopback address on your computer). So the ads will not show up.
How to block ads using hosts file
First you need to go to the path:
- Windows:
C:\Windows\System32\drivers\etc
- Linux:
/etc/hosts
Then open the hosts file to edit the content inside.
By default from Windows 7 onwards, for security reasons you cannot edit directly on the hosts file. So you should use the software notepad++ to open and edit files.
Next copy all the content in the link https://someonewhocares.org/hosts/ Go to the hosts file and save it. This is a list of website addresses with unhealthy content and annoying advertisements. The above link will be regularly updated with advertising addresses. Please come back from time to time to update new addresses.
Besides, you can use software Host Editor Has an easy-to-use interface.
Reference: Bui Nguyen Hoang Tho