-2

I'm trying to block access to a website (e.g site.com), to do so I used dig site.com to get the site's IP adress (I'm on Ubuntu). The result will be something like this:

site.com.       10000   IN  A   101.53.182.181`

Then mapped new IP ( localhost ) to the domain name 'site.com' on /etc/hosts, as the following:

127.0.0.1       site.com

That will do the thing for my local machine, but not for the whole network's devices. Also tried to configure from the router using telnet 192.168.1.1 but I lost it, I don't know how to do it.

How can I manage to block traffic from that particular site? Is there anyway to block access to websites using their IP address?

PS: I tried the classic way to block the site using its domain name (e.g site.com), but it doesn't really 'block the site', I can still access it by searching the website on Google.

Marvin Lucero
  • 468
  • 1
  • 8
yazzy
  • 36
  • 3

1 Answers1

3

You can try accessing your router's web interface. Make sure to set your computer's (laptop's) IP address manually to 192.168.1.2, subnet mask to 255.255.255.0 and then gateway to 192.168.1.1 for the computer's Eth0 interface. I suggest to use the wired interface instead of WLAN or WiFi. Then, access the router on a web browser using 192.168.1.1.

In your router's settings page, look for the following:

  • Block Sites
  • Access Restrictions
  • Security
  • Advanced

or something similar to the mentioned categories above. This may depend on the settings, so I advise to refer to your router's manual. Once you find the setting, indicate the domain/s or IP address (via dig) that you want to block, then apply the settings or changes that you have made.

Marvin Lucero
  • 468
  • 1
  • 8
  • Thank you for your answer, idk why i didn't thought of using IP adress instead of domain name lol, however i still can acces to that site on my phone. I'am Trying to figure out how to set standard ACL to my router interface to deny any request coming from my local network toward that particular site. – yazzy Jun 20 '22 at 13:31
  • This will depend on your router's interface. It can be configured via GUI, or CLI. You can check the model number of your router, then look or check for its manual or online documentation for a more precise guide. – Marvin Lucero Jun 22 '22 at 01:45