Recommended Posts

Hi, this is probably going to seem a little nuts. But I'm trying to ban/block the BBC news web site via the hosts file on my computer. The reason I want to do this is because it's a huge timewaster and I am a bit addicted to it. You can literally spend hours a day on and off going back to and visiting it.

These are the addresses I have tried in my host file so far:

0.0.0.0 www.bbc.co.uk/news/

0.0.0.0 bbc.co.uk/news/

0.0.0.0 www.bbc.co.uk/news

0.0.0.0 bbc.co.uk/news

0,0.0.0 feeds.bbci.co.uk/news

0.0.0.0 feeds.bbci.co.uk

127.0.0.1 feeds.bbci.co.uk

127.0.0.1 feeds.bbci.co.uk/

127.0.0.1 www.bbc.co.uk/news/

127.0.0.1 www.bbc.co.uk/news

127.0.0.1 bbc.co.uk/news/

127.0.0.1 bbc.co.uk/news

127.0.0.1 news.bbc.co.uk

127.0.0.1 news.bbc.co.uk/

127.0.0.1 feeds.bbci.co.uk/

0.0.0.0.0 feeds.bbci.co.uk

127.0.0.1 212.58.246.80

127.0.0.1 212.58.246.81

127.0.0.1 212.58.246.82

127.0.0.1 212.58.246.83

127.0.0.1 212.58.246.84

127.0.0.1 212.58.246.85

127.0.0.1 212.58.246.86

127.0.0.1 212.58.246.87

127.0.0.1 212.58.246.88

127.0.0.1 212.58.246.89

0.0.0.0.0 212.58.246.80

0.0.0.0.0 212.58.246.81

0.0.0.0.0 212.58.246.82

0.0.0.0.0 212.58.246.83

0.0.0.0.0 212.58.246.84

0.0.0.0.0 212.58.246.85

0.0.0.0.0 212.58.246.86

0.0.0.0.0 212.58.246.87

0.0.0.0.0 212.58.246.88

0.0.0.0.0 212.58.246.89

They are all BBC news addresses. But nothing I do seems to work. I'm in danger of flunking my exams if I can't just find a way to casually remind myself that visiting the site isn't a good idea. It's just too easy and tempting, as it's always the first thing that pops up on Google when I type news.

I'm using Ubuntu, so maybe there's another way I can block it too?

Link to comment
https://www.neowin.net/forum/topic/975926-cannot-banblock-bbc-news-site/
Share on other sites

Ok first thing **** like this is invalid

www.bbc.co.uk/news/

same with

0.0.0.0.0 212.58.246.89

You got 5 octets there, and you don't point an IP address at another IP address anyway.

The host file is used to resolve hostname to a IP.. if you want to point it at something that will not work then point it the machines loopback, ie 127.0.0.1

Correct would be

say

127.0.0.1 www.bbc.co.uk feeds.bbci.co.uk bbc.co.uk otherhostnamesyouwanttoblock.

Second is ubuntu even using hosts file first? Check your nsswitch.conf

edit:

"That's the whole BBC web site. I only want to block the news. "

its IMPOSSIBLE to block a /directory with a hosts file! PERIOD!! You can only block host names.. so if it was something like news.bbc.co.uk you could block - but you can not bock www.something.tld/NEWS with a host file without blocking everything at www.something.tld

Use opendns.com and then block the domain names using their manual URL blocking methods.

Or your router probably has a domain filter built in it.

Yeah but it wants a numerical IP address for the site being blocked and the subnet mask and the port and then do the same for my own IP address (the source and destination etc.), subnet mask and so on - and you have to enter them all one at a time. Which means if I have to enter all of the above addresses it would take for ever and be a real pain.

Anyway if blocking the above addresses in my host file doesn't work, then why should it work if I block them on my router?

Surely there's one address that if you block it, it is guaranteed to block the bbc news site? Or maybe it really is impossible?

Are you serious lol! I would much rather waste my time on the BBC than Facebook etc. Anyway

Pinging the BBC resolves to 212.58.244.66. A simple WHOIS returns this . . . You would need to block that entire range :-)

% This is the RIPE Database query service.

% The objects are in RPSL format.

%

% The RIPE Database is subject to Terms and Conditions.

% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Information related to '212.58.224.0 - 212.58.255.255'

inetnum: 212.58.224.0 - 212.58.255.255

org: ORG-BA34-RIPE

netname: UK-BBC-991005

descr: BBC

descr: Kingswood Warren,

descr: Tadworth,

descr: KT20 6NP

country: GB

admin-c: BB231

tech-c: SL108-RIPE

status: ALLOCATED PA

mnt-by: RIPE-NCC-HM-MNT

mnt-lower: BBC-MNT

mnt-routes: BBC-MNT

changed: [email protected] 19991008

changed: [email protected] 20011217

source: RIPE

organisation: ORG-BA34-RIPE

org-name: BBC

org-type: LIR

phone: +443030409777

fax-no: +442088118815

e-mail: [email protected]

admin-c: BBC-RIPE

mnt-ref: BBC-MNT

mnt-ref: RIPE-NCC-HM-MNT

mnt-by: RIPE-NCC-HM-MNT

changed: [email protected] 20040415

changed: [email protected] 20040426

changed: [email protected] 20070813

changed: [email protected] 20070829

changed: [email protected] 20071012

changed: [email protected] 20101213

changed: [email protected] 20101213

changed: [email protected] 20101213

source: RIPE

address: BBC Brandon Butterworth BBC Centre House, 56 Wood Lane W12 7SB London UNITED KINGDOM

person: Brandon Butterworth

address: British Broadcasting Corporation

address: BBC Centre House

address: 56 Wood Lane

address: London

address: W12 7SB

address: England, GB

phone: +44 3030409777

fax-no: +44 2088118815

e-mail: [email protected]

nic-hdl: BB231

mnt-by: BBC-MNT

changed: [email protected] 19931118

changed: [email protected] 19960920

changed: [email protected] 20031211

changed: [email protected] 20101213

source: RIPE

person: Simon Lockhart

address: BBC Internet Services

address: Maiden House

address: Vanwall Road

address: Maidenhead

address: SL6 4UB

address: England, GB

phone: +44 1628 407720

fax-no: +44 1628 407701

e-mail: [email protected]

nic-hdl: SL108-RIPE

mnt-by: BBC-MNT

changed: [email protected] 20010528

changed: [email protected] 20030207

source: RIPE

% Information related to '212.58.240.0/20AS2818'

route: 212.58.240.0/20

descr: BBC

origin: AS2818

mnt-by: BBC-MNT

changed: [email protected] 20090109

source: RIPE

% Information related to '212.58.224.0/19AS2818'

route: 212.58.224.0/19

descr: BBC

origin: AS2818

mnt-by: BBC-MNT

changed: [email protected] 20090109

source: RIPE

No he does not need to block the entire range if he resolves something.domain.tld to 127.0.0.1 - none of that comes into play at all.

most routers allow you to block based on URL, so site.domain.tld/NEWS could be blocked -- host file is used to resolve a host to an IP.. /News is not a host - so you can not block that with resolving a host to an invalid IP.

If you want to block based on URL then sure most routers do that -- or just set it as a blocked site in your browser for that matter.. But you can not do it with a host file.

Here this will prob do what you want

https://addons.mozilla.org/en-us/firefox/addon/blocksite/

BlockSite is an extension, which automagically blocks websites of your choice. Additionally, this extension will disable all hyperlinks to these websites, by just displaying the link text without the clicking functionality.

Ok first thing **** like this is invalid

www.bbc.co.uk/news/

same with

0.0.0.0.0 212.58.246.89

You got 5 octets there, and you don't point an IP address at another IP address anyway.

The host file is used to resolve hostname to a IP.. if you want to point it at something that will not work then point it the machines loopback, ie 127.0.0.1

Correct would be

say

127.0.0.1 www.bbc.co.uk feeds.bbci.co.uk bbc.co.uk otherhostnamesyouwanttoblock.

Second is ubuntu even using hosts file first? Check your nsswitch.conf

edit:

"That's the whole BBC web site. I only want to block the news. "

its IMPOSSIBLE to block a /directory with a hosts file! PERIOD!! You can only block host names.. so if it was something like news.bbc.co.uk you could block - but you can not bock www.something.tld/NEWS with a host file without blocking everything at www.something.tld

So it can't be done? How about nsswitch.conf, or adding some rule (I don't know how to do it) to the ubuntu firewall? Where is nsswitch.conf located?

no firewall would not work either that would be blocking WHOLE host, not just some directory on it.. Use the addon I linked to -- sounds like it will do exactly what you want, and even will remove the link on your google searches to that url if Im reading it right.

nsswitch tells the machine in what order and what services to use for name resolution, ie dns hosts, or hosts then dns that sort of thing - again not what your looking to do.

What your looking to do is block on specific URI -- which not the function of a firewall, that is a content filters via a proxy, you could do it with squid proxy for example. Your looking to do specific content filtering which has nothing to do with name resolution from a name to an IP. What your wanting can not be done with name resolution manipulation or firewalling because /NEWS is not a host nor is in an IP, nor is at a specific PORT, etc. Sure some firewalls have the ability to do URI filtering - but in general you block based on IP, PORT not some specific URI your browser is trying to access on a specific host. URI filtering is not related to the general feature set of a firewall which is protocol, ip, port based -- ie you could block UDP, ICMP, TCP you could block an IP, you could block a specific port via a specific protocol - ie allow UDP 53 but block TCP 53 sort of thing.

Try the addon on linked to.

No he does not need to block the entire range if he resolves something.domain.tld to 127.0.0.1 - none of that comes into play at all.

most routers allow you to block based on URL, so site.domain.tld/NEWS could be blocked -- host file is used to resolve a host to an IP.. /News is not a host - so you can not block that with resolving a host to an invalid IP.

If you want to block based on URL then sure most routers do that -- or just set it as a blocked site in your browser for that matter.. But you can not do it with a host file.

Here this will prob do what you want

https://addons.mozilla.org/en-us/firefox/addon/blocksite/

BlockSite is an extension, which automagically blocks websites of your choice. Additionally, this extension will disable all hyperlinks to these websites, by just displaying the link text without the clicking functionality.

That extension is borked. I tried using it for a while and it gives a bunch of false positives.

False positives? On what -- are you not just putting in the SPECIFIC URI you want to block?? Don't pick any sort of adblocking or malware blocking - just have it block that specific URI.

Ok - I just did a simple test and sure looks to work to me.. So there is a specific host called news.bbc.co.uk btw - noticed it on the main page in the links to news.

So here is how I setup blockedsite

post-14624-0-35412000-1297795047.jpg

Here is with it not blocking

post-14624-0-87506800-1297795071.jpg

now here its blocked -- notice the links are now just text and not links anymore

post-14624-0-52373200-1297795108.jpg

I tried typing in news.bbc.co.uk into my browser - would not work, etc.. So what are you saying is a false positive its giving??

Not to be rude, but wouldn't it just be easier and more profitable in the long run to... I dunno, develop some self-control?

Crazy idea, I know...

False positives? On what -- are you not just putting in the SPECIFIC URI you want to block?? Don't pick any sort of adblocking or malware blocking - just have it block that specific URI.

No if I block BBC news (or anything) I'll get regular annoying pop-ups on most (unrelated) pages I visit saying that some element or other of the content on that page has been blocked and I need to add it to my whitelist. It doesn't matter what site I visit.

Not to be rude, but wouldn't it just be easier and more profitable in the long run to... I dunno, develop some self-control?

Crazy idea, I know...

Bad habits are hard to break. I'm not the only guy who's ever been addicted to a web site. I suspect you have to at some point or other. Sometimes you can break the habit, but like any addiction if it's always there, it's too easy to slip back.

I just edit a previous post - I tested it an works just freaking fine if you ask me!!

Your not WHITELISTING!!! you would have to whitelist everything you want to visit that way.. Look on my settings I did for blocksite in previous post.

edit: set it up exactly how I did -- now show me a false positive example!

btw there is a host called news.bbc.co.uk -- and you could block that.. But thats not going to stop bbc.co.uk/NEWS or www.bbc.co.uk/NEWS etc.. since those are not hosts but a specific URI

Bad habits are hard to break. I'm not the only guy who's ever been addicted to a web site. I suspect you have to at some point or other. Sometimes you can break the habit, but like any addiction if it's always there, it's too easy to slip back.

I know they are hard to break--and I honestly was not trying to be rude. I'm just saying, if you can develop that discipline, it will serve you well in all areas of life.

I've definitely been addicted/spent too much time on websites before (*cough*Neowin*cough*), but can't recall ever neglecting anything really important like schoolwork in favour of it.

I know they are hard to break--and I honestly was not trying to be rude. I'm just saying, if you can develop that discipline, it will serve you well in all areas of life.

I've definitely been addicted/spent too much time on websites before (*cough*Neowin*cough*), but can't recall ever neglecting anything really important like schoolwork in favour of it.

It happens. Just look at the army of Facebook freaks.

I just edit a previous post - I tested it an works just freaking fine if you ask me!!

Your not WHITELISTING!!! you would have to whitelist everything you want to visit that way.. Look on my settings I did for blocksite in previous post.

edit: set it up exactly how I did -- now show me a false positive example!

btw there is a host called news.bbc.co.uk -- and you could block that.. But thats not going to stop bbc.co.uk/NEWS or www.bbc.co.uk/NEWS etc.. since those are not hosts but a specific URI

No you misunderstand. It doesn't work. It works for a while - and then after a bit when you visit a random site , it starts to give the annoying pop-up about content being banned. The whitelist is irrelevant, it's just part of the message in the annoying pop-up that if you don't want some part of the content on such-and such random site blocked, you need to add it to your white list.

It just gets a bit annoying after a while.

I think I'm going to have to just give up and admit that the BBC news site (on it's own) just can't be blocked.

Well no **** warning can get annoying ;) Just turn them off -- you want it to block stuff that has those specific URI in them correct!!! Which is what you want it to do, but no I would not warning everytime it does it ;)

This is what your talking about?

post-14624-0-50457400-1297796555.jpg

I don't know how to do it on my router. It wants a specific numerical IP address, and nothing I tried works. OpenDNS might work, but I have a dynamic IP and there's no IP updater agent that I know of for Ubuntu./

So look at the WHOIS Info I posted and do that.

HINT 212.58.240.0/20 and 212.58.224.0/19

If you are using DynDNS there is an updater for Ubuntu. I cant remember what its called though Im not at my Ubuntu Box

Well no **** warning can get annoying ;) Just turn them off -- you want it to block stuff that has those specific URI in them correct!!! Which is what you want it to do, but no I would not warning everytime it does it ;)

This is what your talking about?

post-14624-0-50457400-1297796555.jpg

Yeah, I turned the warnings off. That might work. BTW OpenDNS sucks slightly. It's a bit of a blunt hammer. I still can't block bbc.co.uk/news, because as you said I can only block the whole domain. If I select to block news, then it bans me from using Neowin too! (And every site that can vaguely be categorised as 'news')

However it is useful for some things.

If you have a dynamic IP and Ubuntu you can do this:

sudo apt-get install ddclient

For anyone that wants it here is a working copy of my ddclient.conf

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
daemon=300
syslog=yes
mail=root
mail-failure=root
pid=/var/run/ddclient.pid
ssl=yes
use=web, web=myip.dnsomatic.com
protocol=dyndns2
server=updates.opendns.com
login=your_email_address_goes_here
password=your_OpenDNS_password_goes_here
the_name_of_the_network_you_chose_for_OpenDNS_goes_here

and finally /etc/default/ddclient:

# Configuration for ddclient scripts 
run_ipup="false"
run_daemon="true"
daemon_interval="300"

Don't forget to change the DNS servers on your router to the OpenDNS servers as I initially did.

Then hopefully you should be able to forget about it.

^ what part of blocking an IP do you people not understand.. he wants to just block www.bbc.co.uk/NEWS not www.bbc.co.uk

This is not possible via IP, if he blocks the IP or resolves to the wrong IP for that host www.bbc.co.uk sure he will not have access to /NEWS but he wont have access to www.bbc.co.uk either.

If you have changed your mind and your ok with blocking the whole SITE bbc.co.uk -- then do that via your host file or router if supports it or for that matter opendns, etc. BTW I don't believe opendns will block www.site.tld/NEWS -- I don't see how its possible, its DNS service not a webfiltering server(proxy).. If you when your machines wants to go to www.bbc.co.uk it gets the IP for that Fully Qualified domain name via dns.. Which is going to be exactly the same if you want to got to www.bbc.co.uk/NEWS

as to this statement "but I have a dynamic IP and there's no IP updater agent that I know of for Ubuntu./"

So -- how often does your IP change??? I have had the same dynamic IP for prob a year now, only reason it changed is I changed the interface on my router so my mac changed - if I wanted to keep the old one I could of change set its mac to my old one, etc.

Just because your ISP assigns you an IP via dhcp does not mean its going to change -- is your router on 24/7/365?? Then highly doubt it will change ever! And if it does, ok then access the opendns site and it will update your IP. the only reason you would have to worry about updating opendns with your IP is if your IP was changing daily.. Which might happen if you actually turn off your router or if directly connected via your PC with no router, etc. If you device is turned off for an extended period.

If you want to just block /NEWS your going to need use something that blocks specific URI, if your router does not do it - and you don't like the perfectly good solution I already gave you - the firefox addon with warning messages turned OFF.

Blocking just /NEWS is not possible via hosts file, firewall, opendns or any other name resolution, IP blocking solution.. Now if your ok with blocking the whole site www.bbc.co.uk, bbc.co.uk, bbci.co.uk, news.bbc.co.uk, etc.. then sure that can be done with host file, router even it sounds like, opendns, etc. keep in mind that machine will cache the IPs to these sites so changing your host file will not instantly block it, you would have to clear its local cache (reboot would do it) Even doing it on your router if this is dns based, your client will still have it cached -- so again, going to have to clear the local machines cache. Same goes for opendns.

But if you just want to block specific URI here is another solution

This should work and exactly what you ask for blocking sites that waste your time ;)

https://addons.mozilla.org/en-us/firefox/addon/leechblock/

LeechBlock is a simple productivity tool designed to block those time-wasting sites that can suck the life out of your working day. All you need to do is specify which sites to block and when to block them.

As to what your router can do -- what is the exact make and model number of your router so we can look at the manual for it and see!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

  • Recent Achievements

    • Week One Done
      mnsgroup earned a badge
      Week One Done
    • Conversation Starter
      sumytbe earned a badge
      Conversation Starter
    • One Year In
      B4dM1k3 earned a badge
      One Year In
    • One Year In
      DarkWun earned a badge
      One Year In
    • Dedicated
      Almohandis earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      525
    2. 2
      +Edouard
      200
    3. 3
      PsYcHoKiLLa
      94
    4. 4
      Michael Scrip
      82
    5. 5
      Steven P.
      69
  • Tell a friend

    Love Neowin? Tell a friend!