Sometimes, for various reasons, we may need to make some websites cannot be accessed from a computer or laptop. The method below (domain mapping) is a simple and unconventional one, through which you can block access to certain websites without using Firewall or Antivirus software.
content
Thus, you can easily block access to facebook.com, Instagram.com or other fields, from a computer with Windows operating system.
Update: The method has been described briefly And here.
How the method works “domain mapping”?
Through domain mapping the user can change the IP address of a domain locally Internet. So, when accessed from a web browser (Chrome, Safari, Firefox, etc.), domain name will have “route” to an IP established by the user instead of the real IP on which it is functional.
For example, facebook.com is the domain name. In order for a domain name to be a web page, this name must be based on an IP address leading to the host server.
Through the file “hosts” You can change the internet domain IP addresses locally. Domain name will lead to User IP address in file “hosts“, instead of responsible for the real IP address. This way you can block access to certain websites or game servers that use domain names in configuration (example: s1.game-server.tld).
How do you block access to certain Windows websites?
To block access to certain Windows computers websites, the easiest thing is to define another IP address to the field on which the website is. As I said above, through the file “hosts” The destination / route of an internet domain can be changed.
The method is applicable on all operating sisemas: Windows XP – Windows 11.
1. Open the text editor Notepad with administrator privileges.
2. Go to Windows operating system files to file “hosts“.
C:\Windows\System32\Drivers\etc
3. open and edit the file “hosts“. It has no extension.

4. Add new lines in which attribute other IP addresses to domains (host names) you want to block.

For example, if you want to block access to Facebook and Instagram, add to the file “hosts” the lines below.
127.0.0.1 facebook.com
127.0.0.1 instagram.com
127.0.0.1 fb.com
127.0.0.1 *.facebook.com
127.0.0.1 *.fb.com
127.0.0.1 *.instagram.com
4. Save the changes made.
After this step, the websites on the name of areas for which the IP address was modified will no longer be accessible from that computer.

If you want to cancel the restrictions, it is sufficient to edit the file again “hosts” and put the symbol “#” in front of each line.
It is very possible that after more important updates of the operating system (Windows Updates), this file “hosts” be rewritten or automatically replaced with the original one.
A simple method of domain mapping through which you can block access to certain websites without using Firewall or Antivirus software.