Blocking Websites on Safari

Discussion in 'Mac Basics and Help' started by jusacruiser, Nov 14, 2016.

  1. jusacruiser macrumors 6502

    jusacruiser

    Joined:
    Mar 15, 2009
    Location:
    Atlanta, Georgia
    #1
    Is there a way I can BLOCK websites on Safari? There are unwanted websites that keep "Cookie-ing" me.......and I want to BLOCK that unwanted audience.

    PS: This is not about Parental Controls. I am an adult that just wants to BLOCK unwanted websites.

    Thank you!
     
  2. satcomer macrumors 603

    satcomer

    Joined:
    Feb 19, 2008
    Location:
    The Finger Lakes Region
    #2
    What I use is OpenDNS.com to block sites!
     
  3. rshrugged macrumors 6502a

    Joined:
    Oct 11, 2015
    #3
    You could edit your hosts file. After doing so, flush your DNS cache.
     
  4. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #4
    Here are instructions on how to edit the Hosts file: http://www.simplehelp.net/2012/01/25/how-to-edit-the-hosts-file-in-os-x-lion-the-very-easy-way/

    The default hosts file will look like this:

    ##
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost
    To block a site, say www.Mackeeper.com, add the following line to the hosts file after the line "255.255.255.255 broadcast host":

    0.0.0.0 www.mackeeper.com

    so that the hosts file now reads:

    ##
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcast host
    0.0.0.0 www.mackeeper.com
    ::1 localhost
    fe80::1%lo0 localhost​

    Save the file then restart the computer (or flush the DNS cache by entering the following line into terminal and hitting return:

    sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder; say cache flushed

    Restart your browser and you should find the site is now blocked.

    You can block as many sites as you want by adding them on separate lines as above.
     
  5. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #5
    Just use an ad blocker. Host files are not really great for blocking websites, because they requires specific domain names or IP addresses. A program as ubiquitous as MacKeeper is probably using a variety of hostnames.
     

Share This Page