Blocking Websites with /etc/hosts
Solution 1
Rather then make this block using /etc/hosts
I'd suggest using a browser addon/plugin such as this one named: BlockSite for Firefox or StayFocusd for Chrome.
BlockSite
StayFocusd
But I want to really use /etc/hosts file
If you must do it this way you can try adding your entries like this instead:
0.0.0.0 www.example.com
0.0.0.0 example.com
::0 www.example.com
::0 example.com
You should never add entries to this file other than hostnames. So don't put any entries in there that include prefixes such as http://
etc.
Solution 2
You need to flush your DNS cache. According to this article, you can do that by restarting the following services:
nscd
dnsmasq
named
Related videos on Youtube
iosdev
Updated on September 18, 2022Comments
-
iosdev almost 2 years
Possible Duplicate:
Can I show an UISegmentedControl object in vertical?How to make a UIsegmentController vertical ,I tried using,
segmentedControl.transform = CGAffineTransformMakeRotation(M_PI / 2.0);
but its make the segment control fonts to vertical.Can any one help me to code for vertical segmentcontrolbar?
-
Cyrille over 11 yearsBTW, there's no need to write
M_PI / 2.0
, there's already aM_PI_2
constant defined (andM_PI_4
, for what it's worth). -
Paras Joshi over 11 yearssee some links in my answer with some desc... :)
-
-
iosdev over 11 yearssubview.subviews shows error..propert not found
-
iosdev over 11 yearsi just want to make the segment control as like stackoverflow.com/questions/9168840/…
-
iosdev over 11 yearsi want to make like this stackoverflow.com/questions/9168840/…
-
Paras Joshi over 11 yearshey if insted of segment control you use dropdawn box then its ok??
-
jasonwryan about 10 yearsThe OP does expressly ask for solutions that don't involve browser plugins/extensions...
-
slm about 10 years@jasonwryan - thanks, missed that last sentence in the Q.
-
Newb about 10 yearsThe last part of your answer was correct --- my mistake was that I had written
http://www.example.com
instead ofwww.example.com
. Now the site is blocked. -
Eric over 8 yearsThis is useful, and both chrome & firefox has an extension named
block site
, both great. -
Rui F Ribeiro over 7 yearsAlas, what I needed was a plug-in that would ignore all the links to other sites than the current one and would be activated to sites of my own choice.
-
Admin over 7 yearsThe article is from 2008 and appears to be out of date. My linux mint install doesn't have nscd or rndc.
-
Nick about 4 yearssudo systemd-resolve --flush-caches worked on ubuntu 20.04
-
Thorkil Værge almost 3 yearsA modification to the
hosts
file should take effect without having to restart anything. In case of redirects, you may have to block the target of the redirect too, though.