Unable to block three particular websites through /etc/hosts
Linux - NewbieThis 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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.