Results 1 to 9 of 9

Thread: Easy way to ban a few websites? Had poor experience with dansguardian.

  1. #1
    Join Date
    Apr 2011
    Beans
    24

    Easy way to ban a few websites? Had poor experience with dansguardian.

    Hello,

    I need to stop people using my laptop running Ubuntu 12.10 from going to just a handful of domains.

    I installed dansguardian using the instructions here http://ubuntuforums.org/showthread.php?t=207008

    However, it was a disaster. It filtered most of the websites I use - like Bank of America or Amazon.com - but not any of the Google sites. I never figured out why. Posting to the dansguardian mailinglist and waiting 3 days was not helpful. Didn't get a single reply. So I uninstalled using instruction here: http://ubuntuforums.org/archive/index.php/t-311089.html.

    My question: is there a easy way to ban a few domains?

    The router built into my wifi hotspot does not have website filtering capability. I am not an experienced linux user. Please kindly write out the code if your solution involves the terminal.

  2. #2
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    Suppose you do ban a website say "www.example.com", will they not be able to access it via a web-based anonymous proxy service like anonymouse.org ?

  3. #3
    Join Date
    Apr 2011
    Beans
    24

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    Quote Originally Posted by 3v3rgr33n View Post
    Suppose you do ban a website say "www.example.com", will they not be able to access it via a web-based anonymous proxy service like anonymouse.org ?
    The people I am dealing with are not that knowledgeable.

  4. #4
    Join Date
    Feb 2012
    Location
    Athens/Greece
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    Hi ,
    you can add some websites in /etc/hosts file .. and block them. Be aware , the full web address is needed.
    Open the file with this command
    Code:
    gksudo gedit /etc/hosts
    and add
    example format
    Code:
    127.0.0.1        www.google.com
    Save the file and close and open the browser again .. and you will see a message like "Unable to connect" , when you visit www.google.com

    This method can be bypassed from an experienced user.

    Thanks

  5. #5
    Join Date
    Apr 2011
    Location
    3rd Rock from the Sun
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    polaatx, /etc/hosts is IMO a good way to restrict some "known" bad domains. You can download a 'hosts' file from here, offcourse there are other providers if you care to search. You can edit this hosts file to add or subtract domains.
    After downloading the hosts file (You may have to extract it and rename it to hosts).

    Code:
    $ sudo nautilus
    Delete the /etc/hosts file or back it up and replace it with the hosts file you've downloaded. That is all.

    To edit it:

    Code:
    $ sudo gedit /etc/hosts
    Also some sort of Browser Protection with addons like ADBLOCK, NoScripts, Ghostery, etc you can keep the 'bad' elements from any website at bay.

    Just my two cents...

    EDIT: enable UFW (Uncomplicated Fire Wall) follow steps here.

    Good Luck
    Last edited by fantab; December 23rd, 2012 at 12:46 PM.
    "Evolution is Nature's way of issuing upgrades."


  6. #6
    Join Date
    Aug 2011
    Beans
    348
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    Adding to what fantab wrote, the easiest way to block some site is at the firewall. First, you will probably need the ip addresses of the sites - whois can help there, ping can help, etc. Then activate your firewall. Ubuntu provides ufw as mentioned which would probably be the easiest way. In the firewall, you will want to deny both incoming and outgoing packets to the ip addresses you found. DROP, don't REJECT them. You may or may not want to omit logging of them, too. See the man page (man ufw) for specific instructions.

    When dealing with a firewall it is best to spend a few minutes learning how to do it rather than blindly following some script you see somewhere. It really isn't as confusing or as difficult as it may seem at the start. And be sure ufw automatically loads and activates at boot time.

  7. #7
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    I believe that the /etc/hosts way is a better way than the firewall, because it will stop the request going out in the first place and does not depend on having the correct IP address in the firewall config. Don't forget that many domains may operate across a range of IPs and blocking one of them is not enough, while adding all possible IPs is tedious.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  8. #8
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    Quote Originally Posted by polaatx View Post
    ...I need to stop people using my laptop running Ubuntu 12.10 from going to just a handful of domains...
    Why not just stop other people using your laptop or give them their own accounts?

    You could logout when you are not using it or hit Ctrl + Alt + L to lock the screen while remaining logged in.

  9. #9
    Join Date
    Aug 2011
    Beans
    348
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Easy way to ban a few websites? Had poor experience with dansguardian.

    /etc/hosts will work for OUTGOING packets, not incoming. Blocking a range of ips with iptables is not at all difficult. As a matter of fact, you don't really need the ip(s) for iptables. The network/site name will suffice, although that is not recommended.

    I prefer doing the work to stop packets at the firewall since I can foresee, in my case, the hosts file growing to an unmanageable size and actually slowing everything down. Since the firewall packet inspection is actually done by the kernel it seems to be faster. Long and complicated firewall setups can slow things down, of course, but I usually don't see much problem with that.

    Obviously if I couldn't catch everything at the firewall then I would resort to the hosts file, but personally that would be my third choice. My first choice would be to keep people off my laptop, second choice firewall, third choice hosts file. But, different strokes as they say. I think the OP has enough info to see the pros and cons of each and make a fitting decision.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •