Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-11-2012, 01:34 AM
|
#1
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
How to block some parts of a website through /etc/hosts?
For example if a website has 10 sections,
I'd like to block 3 of them, only.
System admins here aren't willing to help in
this case. So, is there a way to do this through
/etc/hosts etc.?
|
|
|
05-11-2012, 01:45 AM
|
#2
|
Member
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190
Rep:
|
well, if that websites have different subdomain and different IP address for that domain, that you can make a wrong IP entry to those domain into /etc/hosts. that can work
for eg:
Code:
cat /etc/hosts
127.0.0.1 www.google.com
127.0.0.1 www.facebook.com
127.0.0.1 abc.test.com
so if browser query for dns name, it will get a loopback IP, and try to open it. hence websites will not open
Last edited by em31amit; 05-11-2012 at 01:51 AM.
|
|
|
05-11-2012, 01:48 AM
|
#3
|
Senior Member
Registered: Dec 2008
Posts: 4,732
Original Poster
|
For "example", LQ has sub forums, and if I'd like
to block 5 particular sub forums out of 10, then
what am I supposed to do?
|
|
|
05-11-2012, 02:01 AM
|
#4
|
Member
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347
Rep:
|
You can't with /etc/hosts since it accepts only domains and ip addresses so you'll end up to block entire sites, not oly some pages.
For this purpose you use aproxy like squid and configure its policies.
|
|
1 members found this post helpful.
|
05-11-2012, 02:02 AM
|
#5
|
Member
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190
Rep:
|
Code:
cat /etc/hosts
ACTUAL IP www.linuxquestions.org
127.0.0.1 iso.linuxquestions.org #want to block so user can't download heavy iso files
127.0.0.1 jobs.linuxquestions.org #NO more job search here
|
|
1 members found this post helpful.
|
05-11-2012, 02:05 AM
|
#6
|
Member
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347
Rep:
|
If the url you want to block is an entire domain (even third level domain) it's ok and you can use /etc/hosts like you shown, but if you want to block a specific page or url like www.linuxquestions.org/reviews/ you have to find another way.
|
|
|
05-11-2012, 02:09 AM
|
#7
|
Senior Member
Registered: Dec 2008
Posts: 4,732
Original Poster
|
Quote:
Originally Posted by em31amit
... iso.linuxquestions.org ... jobs.linuxquestions.org
|
Actually this worked, but I was talking about
sections like newbie, software, /General etc.
Quote:
Originally Posted by Slackyman
You can't with /etc/hosts since it accepts only domains and ip addresses so you'll end up to block entire sites, not oly some pages.
For this purpose you use aproxy like squid and configure its policies.
|
Alright, will read upon those things.
Thanks.
|
|
|
07-26-2012, 02:33 PM
|
#8
|
Senior Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030
|
Here you will find more info about how and why to block sites: http://pgl.yoyo.org/as/
I believe the 1st reason is the ads that come with most pages now days and it does require extra bandwidth to browse, it may effect more those who don't have fast connection, in any case to block ads is the one thing that concerns people more.
Personally I do hate ads, side, top, botton banners blinking only serve to distract. I do never ever click on them, so why not to block them.
Here my list of blocks:
Code:
127.0.0.1 doubleclick.net
127.0.0.1 ad.doubleclick.net
127.0.0.1 ad.ca.doubleclick.net
127.0.0.1 adremote.timeinc.net
127.0.0.1 adsremote.scripps.net
127.0.0.1 a.as-us.falkag.net
127.0.0.1 interclick.com
127.0.0.1 a1.interclick.com
127.0.0.1 media.fastclick.net
127.0.0.1 network.realmedia.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 ad.ad-flow.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 ad.bannerconnect.net
127.0.0.1 ww57.smartadserver.com
127.0.0.1 www3.smartadserver.com
127.0.0.1 partner.googleadservices.com
127.0.0.1 ad2.netshelter.net
127.0.0.1 a.collective-media.net
127.0.0.1 ad.103092804.com
127.0.0.1 ad.adperium.com
127.0.0.1 ad.yieldmanager.com
127.0.0.1 ads.youporn.com
127.0.0.1 partner.googleadservices.com
127.0.0.1 ads.justrelevant.com
127.0.0.1 ads.associatedcontent.com
127.0.0.1 ads.blogtalkradio.com
127.0.0.1 ads.fulldls.com
127.0.0.1 adserver.adreactor.com
127.0.0.1 adserver.zwame.pt
127.0.0.1 ads2.globo.com
127.0.0.1 adserv.legitreviews.com
127.0.0.1 adsrv.deviantart.com
127.0.0.1 ads.cnn.com
127.0.0.1 ad.zanox.com
127.0.0.1 ad.kickasstorrents.com
127.0.0.1 at-adserver.alltop.com
127.0.0.1 ads.trackitdown.net
127.0.0.1 cdn1.ads.contentabc.com
127.0.0.1 ads.crakmedia.com
127.0.0.1 data.ero-advertising.com
127.0.0.1 ads.trafficjunky.net
127.0.0.1 media.trafficjunky.net
127.0.0.1 media.adxpansion.com
127.0.0.1 a.tribalfusion.com
127.0.0.1 cs.adxpansion.com
127.0.0.1 ifa.camads.net
127.0.0.1 clickserv2.sitescout.com
127.0.0.1 infinityads.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 ads.ad4game.com
127.0.0.1 ads.adk2.com
127.0.0.1 ads.dothads.com
127.0.0.1 ads.e-planning.net
127.0.0.1 ads.pixfuture.net
127.0.0.1 ads.pubmatic.com
127.0.0.1 ads.supplyframe.com
127.0.0.1 ads.undertone.com
127.0.0.1 adsearch.adkontekst.pl
127.0.0.1 ads.cpxcenter.com
127.0.0.1 ads.lzjl.com
127.0.0.1 ads.pointroll.com
127.0.0.1 adserver.adtechus.com
127.0.0.1 adshuffle.com
127.0.0.1 adsrvr.org
127.0.0.1 adtech.de
127.0.0.1 advertising.com
127.0.0.1 adxpose.com
127.0.0.1 ero-advertising.com
127.0.0.1 d.adsbyisocket.com
127.0.0.1 ad.adserver01.de
127.0.0.1 ib.adnxs.com
127.0.0.1 d.afdads.com
127.0.0.1 click.adbrite.com
127.0.0.1 this.content.served.by.adshuffle.com
127.0.0.1 br.betclic.com
127.0.0.1 ib.adnxs.com
127.0.0.1 v2.afilio.com.br
127.0.0.1 pixel.mathtag.com
127.0.0.1 stats.sellbuyads.com
127.0.0.1 stats.buysellads.com
127.0.0.1 s3.buysellads.com
127.0.0.1 dspads.sitescout.netdna-cdn.com
Regards
|
|
|
All times are GMT -5. The time now is 09:28 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|