2
I know that there are many tutorial and probably topics about it, but I just can't configure it to work for me. I hope someone could help me :) I'm using Windows 10, but it shouldn't be problem.
So, first here is the website (for example) I'd like to block: http://www.uni-pannon.hu/
Pinging returns:
C:\Windows\system32>ping www.uni-pannon.hu
Pinging www.uni-pannon.hu [193.6.32.90] with 32 bytes of data:
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Ping statistics for 193.6.32.90:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
My default gateway seems to be the following:
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : vekoll.uni-pannon.hu
Description . . . . . . . . . . . : Realtek PCIe FE Family Controller
Physical Address. . . . . . . . . : 74-86-7A-1B-5E-A7
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::e909:6fbe:a499:2979%8(Preferred)
IPv4 Address. . . . . . . . . . . : 10.3.1.122(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Lease Obtained. . . . . . . . . . : 2016. január 6., szerda 3:30:58
Lease Expires . . . . . . . . . . : 2016. január 7., csütörtök 18:01:52
Default Gateway . . . . . . . . . : 10.3.0.1
DHCP Server . . . . . . . . . . . : 10.3.0.1
DHCPv6 IAID . . . . . . . . . . . : 74745466
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-0E-41-5B-74-86-7A-1B-5E-A7
DNS Servers . . . . . . . . . . . : 193.6.40.4
193.6.40.2
NetBIOS over Tcpip. . . . . . . . : Enabled
So, as a route gateway I choose an unreachable host:
C:\Windows\system32>ping 10.3.0.100
Pinging 10.3.0.100 with 32 bytes of data:
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.
Ping statistics for 10.3.0.100:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Based on the datails I copied above, I "crafted" the following command:
route -p add 193.6.32.90 mask 255.255.255.0 10.3.1.100
After successfully adding this route, I tried to ping 193.6.32.90 and both the website, but I could reach both of them. Then I tried to access the website via browser, but it's still available.
Could anyone tell me where did I fail? Before anyone telling me to use hosts file, I'd like to find a different method to block websites (via native windows solutions).
Edit: Tried flushing as it's shown here: https://stackoverflow.com/questions/9739156/how-to-flush-route-table-in-windows
Edit2: After trying to add a route which a comment suggested, here's my whole route table:
2first the mask should be 255.255.255.255, which may affect the "specificity" of the result. if you want your custom route to be evaluated first, it must be the most specific, lowest metric, route to the destination, so confirm your custom routes metric is lower than the default gateway. it may help us help you if you post your route table. – Frank Thomas – 2016-01-07T01:00:26.220
try
route -p add 193.6.32.90 mask 255.255.255.255 127.0.0.1 1
– Frank Thomas – 2016-01-07T03:25:09.683Not even the route you told blocked the desired website. I added my whole rout table (route print) as a pastebin link to the main question. ( http://pastebin.com/raw/3CGHSCKx )
– original.roland – 2016-01-07T09:53:45.780If your goal is to create a blacklist you could edit the
hosts
file. Simply put an entry (www.badsite.com, for example) pointing to the localhost (127.0.0.1). – Adriano P – 2016-01-16T03:25:31.380