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-10-2012, 07:24 AM
|
#1
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
Unable to block three particular websites through /etc/hosts
http://www.dpreview.com/
http://www.kodakgallery.com/gallery/welcome.jsp
http://www.fotolia.com/
All sites specified excluding these three have
been blocked successfully.
How to block these three too now?
Is there some particular way to specify certain
website names?
/etc/hosts:
Code:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.2 linux-y3pi.site linux-y3pi
192.168.16.86 linux-y3pi.site linux-y3pi
127.0.0.1 1x.com
127.0.0.1 photo.stackexchange.com
127.0.0.1 dpreview.com
127.0.0.1 camshotsindia.com
127.0.0.1 500px.com
127.0.0.1 photo.net
127.0.0.1 fotolia.com
127.0.0.1 deviantart.com
127.0.0.1 kodakgallery.com
and yes, I did run /etc/init.d/nscd restart
after saving the hosts file. Didn't help.
Code:
# uname -a && cat /etc/issue
Linux linux-y3pi 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux
Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).
Last edited by Aquarius_Girl; 05-10-2012 at 07:31 AM.
|
|
|
05-10-2012, 07:36 AM
|
#2
|
Senior Member
Registered: Mar 2012
Posts: 1,882
|
You have listed dpreview.com not www.dpreview.com
|
|
1 members found this post helpful.
|
05-10-2012, 08:51 AM
|
#3
|
Senior Member
Registered: Dec 2008
Posts: 4,732
Original Poster
|
But then shouldn't that apply to all other websites too?
Why only dpreview?
|
|
|
05-10-2012, 09:42 AM
|
#4
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
Put both in and see if it works.
I guess dns cache deals might be in effect. Might have to restart browser to take effect changes.
Test with nslookup or dig too both www and without.
|
|
1 members found this post helpful.
|
05-10-2012, 09:47 AM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
You're blocking a site that's even in your own signature? Oh the irony... do as I say, don#'t do as I do, huh?
The other "www" domains may well be listed in DNS as CNAME for the non-www version.
Last edited by acid_kewpie; 05-10-2012 at 09:49 AM.
|
|
1 members found this post helpful.
|
05-10-2012, 11:23 PM
|
#6
|
Senior Member
Registered: Dec 2008
Posts: 4,732
Original Poster
|
Putting www. in front of dpreview helped.
I curious to know why was it needed for the
dpreview and not for 500px?
Quote:
Originally Posted by acid_kewpie
You're blocking a site that's even in your own signature? Oh the irony... do as I say, don#'t do as I do, huh? 
|
Am doing this on my own computer in office.
Problems of addictions.
|
|
|
05-11-2012, 06:47 PM
|
#7
|
Senior Member
Registered: Mar 2012
Posts: 1,882
|
As stated above, most likely www.500px.com is a cname to 500px.com so your dnsclient looks up www.500px.com, is redirected to 500px.com which it looks up and finds a match in your /etc/hosts to 127.0.0.1 = effectively blocked.
If www.500px.com was an A record pointing to a valid IP you would also resolve that normally.
|
|
|
All times are GMT -5. The time now is 05:09 PM.
|
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
|
|