Hosts-update: automatically append the mvp blocklist to /etc/hosts

This util written by wintervenom has actually been in the AUR for going on 2 years now. 
What it does:
Updates /etc/hosts with the mvps blocklist to prevent thousands of parasites, hijackers and unwanted adware/spyware/privacy websites from working.
Operation is trivial:
1) Edit /etc/hosts.local to match the hostname of your system and adjust the domainname as needed. Also add any hosts that you wish to keep i.e. other PCs on your network.
2) Run /usr/bin/update_hosts as root which will append /etc/hosts.local to the mvps blocklist and apply some post processing writing the final file to /etc/hosts automatically.
3) (Optional) Add a cronjob under root crontab at some interval to keep your /etc/hosts fresh.
AUR: https://aur.archlinux.org/packages/hosts-update
Github: https://github.com/graysky2/hosts-update
Original thread: https://bbs.archlinux.org/viewtopic.php?id=106367
Enjoy!
Last edited by graysky (2013-12-11 17:09:06)

Sure you can, but not in this particular tool.  There is a script written by haarp designed to run on a tomato-usb powered router that does just this.  I host the code here: https://github.com/graysky2/adblock
EDIT: I can't remember if it pulls from the same urls as pgl does but you can certainly modify the code to do it.
Last edited by graysky (2013-12-11 19:52:02)

Similar Messages

  • Appending a blocklist to /etc/hosts

    Is it possible to append a blocklist (er... redirectlist) to /etc/hosts somehow?
    For example, mvps has been supplying a very nice list of known parasite websites for years.  Basically, it just uses 127.0.0.1 to redirect known bad websites so they don't load. It's a nice system-wide method to block them.  I have been pasting their list into my /etc/hosts but am wondering if I can someone call it as I do in bash scripts.
    For example, this doesn't work, but you get idea:
    $ cat /etc/hosts
    127.0.0.1 localhost.localdomain localhost novelty
    192.168.1.1 router
    192.168.1.2 inky
    192.168.1.3 blinky
    . /etc/hostsmvps # try to load the mvps redirect list

    Wintervenom wrote:
    Copy your local machine and network hosts to "/etc/hosts.local," then:
    #!/bin/dash
    ### MVPS Hosts Updater #########
    # Version 0.3 by Scott Garrett #
    # Wintervenom [(at)] gmail.com #
    # Download the MVPS hosts file.
    wget -c -O /tmp/hosts.txt http://www.mvps.org/winhelp2002/hosts.txt
    # Be paranoid and replace every IP address with 0.0.0.0. We also get
    # only want the actual blacklist, 'cause we want to prepend the user's
    # own hosts. 0.0.0.0 is nicer than constantly knocking on localhosts' door.
    sed -r -e 's:^([0-9]{1,3}\.){3}[0-9]{1,3}:0.0.0.0:' /tmp/hosts.txt > /tmp/hosts.new.txt
    tail -n+`grep -nF 'start of lines' /tmp/hosts.new.txt | cut -d':' -f1` /tmp/hosts.new.txt > /tmp/hosts.txt
    # Write this new list over the system hosts list. MVPS' line feeds
    # are \n\r; we will be getting rid of those dirty carriage returns.
    # We'll first write the user's hosts head, then the black list.
    cat /etc/hosts.local > /etc/hosts
    cat /tmp/hosts.txt | tr -d "\r" >> /etc/hosts
    rm /tmp/hosts*.txt
    # This is the end!
    Thanks for the script, I actually wrote one very similar to yours but then thought I'd ask about sourcing it like a bash script does...
    Last edited by graysky (2010-10-10 16:04:16)

  • Update automatically about the data warehousing

    I have done data warehousing using owb, but what way or how can we let the cube update automatically when the original tables changed? thank you

    You'll need to building mappings to load your source data to your cubes and then one option is to schedule these to run via a process flow and scheduled job.
    Search the Net for 'Oracle OWB by example' for some tutorials.
    Regards
    Si

  • I've had my HTC Rhyme for about 4 months and it updated automatically to the software that was right before Google Play.  When I try to update to Google Play, it says there's no service, but there is.  What should I do?

    I've had my HTC Rhyme for about 4 months and it updated automatically to the software that was right before Google Play.  When I try to update to Google Play, it says there's no service, but there is.  What should I do?

        Hello!
    No Play Store, sounds like no fun! Let's get this fixed! I would recommend trying the store in safe mode first. If that doesn't work a hard reset would be the next step. Here are the steps for both:
    Safe Mode http://bit.ly/yAHjEJ
    Hard Reset: http://bit.ly/xCo3Hk
    Let us know if that works!
    Katie H
    VZW Support
    Follow us on Twitter @VZWSupport

  • Is Microsoft Automatic Updates - automatically removing the microsoft JVM?

    Is Microsoft Automatic Updates - automatically removing the microsoft JVM?
    just checking because, if so, that has a huge implication.
    Stephen

    I am all up to date with updates, and I still have the MS-JVM. Though it has been updated in both the last two updates.

  • Please assist, my notebook updates automatically with the latest version of firefox, which was done, thereafter i am having problems when i open the firefox

    My notebook is set to update Firefox automatically which it did last night. Since the update, when i open the Firefox browser, it opens up several tabs after the home page. I am also unable to copy of the page, when i do try it opens up the very same page in another tab. Also i am experiencing problems with my Microsoft office programs, since the Firefox update was done. I am unable to open documents within the programs, when i do click to open a new document or try to open an old document, it automatically closes the program. My operating system is Windows 7 home Basic, 32-bit operating system.
    Please help, thank you.
    Regards, Kyle Campbell
    Email: [email protected]

    If you don't usually get a choice of where to save a downloaded file, you can change that using:
    Edit > Preferences > General > "Always ask me where to save files"
    Then you may want to go directly to the source:
    http://www.mozilla.com/firefox/
    You should get the options to Save File or Cancel (not Open). Hopefully after saving you will be able to find the downloaded file in the location you specified.
    One other note, before upgrading, you may want to back up your Firefox settings just in case. [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information].

  • There is a problem with the mail updating automatically in the toolbar at the top of the page ! my seeting s are correct. i did not have this problem with early versions!! not good,

    firefox wont update the mailbox to inform you you have new mail.
    preivious version was ok.
    all settings are correct .
    tried starting new and still the same

    Sorry, that "mail" thing isn't a standard part of Firefox. Seek support from the developer of the add-on you have installed that added that feature to Firefox. Support contact information should be on the download page for that extension.

  • Should the loopback alias in /etc/hosts be localhost?

    This was something I ran across recently when installing NTP...for some reason, if I change the loopback alias to my actual machine name, the command <code>ntpq -p</code> would not work...it would reply: Name or service not known.  However, leaving the alias as localhost and trying the command again works just fine.
    The reason I had altered it initially was due to Xfce giving me a warning dialog box upon startup that says it cannot find the host.  Changing my loopback line to
    127.0.0.1 localhost.localdomain servername
    instead of the default...
    127.0.0.1 localhost.localdomain localhost
    eliminated that error message and Xfce would start up with no problems.  I vaguely remember reading somewhere that it should be left at localhost and not be set to your actual machine name, but I don't remember the reasoning behind it.  Do I really have to choose one error or the other?  Any thoughts?

    Ahhh...never knew you could do that.  I'll give that a shot once I get home and let you know if it worked.  Thanks Mr. Prickly!

  • What is the original file /private/etc/hosts ?

    Trying to understand I made a bad edit !
    Thanks !

    To set it back, it should read like this. At least, this is the content on my Mac.
    # 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
    Don't know if it would make a difference, but the first and fourth sentences ending with "localhost" use a tab character for the space between 127.0.0.1 and fe80::1%lo0. The second and third lines are padded out with space characters.

  • Update manager in IdM automatically when the manager changes in SAP HR

    Hi Experts
    I have been given a requirement where the manager of a user in IdM should be updated automatically when the manager changes in SAP HR.
    The HR extraction job is currently in place and runs every 30mins.
    Please could you give me some ideas on how to implement this.
    IDM 7.2 SP 6
    Thanks
    Ran

    Hi Deepak
    I have been discussing this a bit more in detail with the client. So, the issue is as follows
    When a new/replacement manager is hired
    When people are moved from one org unit to another
    The scheduled extraction job (RPLDAP_EXTRACT_IDM with a variant with the delta tick on) does not update the new manager info in IDM for the relevant users who report to that manager. The client has to run the program (RPLDAP_EXTRACT_IDM with a variant with the delta tick off) manually each time for the affected users which updates the manager info successfully in idm.
    I investigated the query LDAP_IDM_QUERY from user group /SAPQUERY/L1 and want to know if the below should be ticked as well. Your thoughts please?
    Please advise.
    Thanks
    Ranjit

  • Lil' script to update adblockfilter, adblocking via /etc/hosts file

    hi, i've recently changed to adblocking via the hosts file (which works great btw), but i was missing  filtersetupdating like in firefox, so i've created with my limited scripting skills this one...
    # lil' script to update /etc/hosts adblock-filter
    #hosts adblock filter taken from this site...
    wget --directory-prefix=/tmp http://www.mvps.org/winhelp2002/hosts.txt
    #Backup /etc/hosts to /tmp
    cp /etc/hosts /tmp
    #standard static hosts file
    echo '# /etc/hosts: static lookup table for host names' > /etc/hosts
    echo '#' >> /etc/hosts
    echo '#<ip-address> <hostname.domain.org> <hostname>' >> /etc/hosts
    echo '127.0.0.1 localhost.localdomain localhost' >> /etc/hosts
    #add custom statc host configuration here
    echo ' ' >> /etc/hosts
    echo '###Ad-Blocking###' >> /etc/hosts
    cat /tmp/hosts.txt >> /etc/hosts
    echo '# End of file' >> /etc/hosts
    rm /tmp/hosts.txt
    enjoy!

    hosts_udate
    #!/bin/bash
    # 2012 Ontobelli for this script
    # make hosts temporal directory
    HOSTSDIR=~/.hostsupdate
    mkdir -p "${HOSTSDIR}"
    # make temporary directory
    TMPDIR=/tmp/hostsupdate
    mkdir -p "${TMPDIR}"
    # set output file
    OUTPUTFILE="${TMPDIR}/hosts"
    # set temporal file
    TMPFILE="${TMPDIR}/tmpfile"
    if [ ! -f "${HOSTSDIR}/hosts.local" ]; then
    echo "You need to create "${HOSTSDIR}"/hosts.local containing the hosts you wish to keep!"
    exit 0
    fi
    # download the mvps.org hosts file.
    wget -c -O "${HOSTSDIR}/hosts.mvps" "http://winhelp2002.mvps.org/hosts.txt"
    # download hpHOSTS
    wget -c -O "${HOSTSDIR}/hosts.hphosts" "http://support.it-mate.co.uk/downloads/HOSTS.txt"
    # download hpHOSTS Partial
    wget -c -O "${HOSTSDIR}/hosts.partial" "http://hosts-file.net/hphosts-partial.asp"
    # download hpHOSTS ad/tracking servers
    wget -c -O "${HOSTSDIR}/hosts.adservers" "http://hosts-file.net/ad_servers.asp"
    # download the pgl.yoyo.org hosts Peter Lowe - AdServers
    wget -c -O "${HOSTSDIR}/hosts.yoyo" "http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext"
    # download SysCtl Cameleon hosts
    wget -c -O "${HOSTSDIR}/hosts.sysctl" "http://sysctl.org/cameleon/hosts"
    # cat entries in a single file
    cat "${HOSTSDIR}/hosts.mvps" > "${TMPFILE}0"
    cat "${HOSTSDIR}/hosts.hphosts" >> "${TMPFILE}0"
    cat "${HOSTSDIR}/hosts.partial" >> "${TMPFILE}0"
    cat "${HOSTSDIR}/hosts.adservers" >> "${TMPFILE}0"
    cat "${HOSTSDIR}/hosts.yoyo" >> "${TMPFILE}0"
    cat "${HOSTSDIR}/hosts.sysctl" >> "${TMPFILE}0"
    # tabs to space
    sed -e 's/ / /g' "${TMPFILE}0" > "${TMPFILE}1"
    # find relevant lines without comments
    grep ^127.0.0.1 "${TMPFILE}1" > "${TMPFILE}2"
    # remove duplicate spaces
    cat "${TMPFILE}2" | tr -s [:space:] > "${TMPFILE}3"
    # remove carriage returns
    cat "${TMPFILE}3" | tr -d "\r" > "${TMPFILE}4"
    # 0.0.0.0 is nicer than constantly knocking on localhosts' door.
    sed -e 's/127.0.0.1 /0.0.0.0 /g' "${TMPFILE}4" > "${TMPFILE}5"
    # remove inline comments
    cut -d ' ' -f -2 "${TMPFILE}5" > "${TMPFILE}6"
    # sort blocklist entries and remove duplicates
    sort "${TMPFILE}6" | uniq > "${TMPFILE}7"
    # remove unneeded blocked sites
    grep -Ev ' dl.dropbox.com| host_you_want_to_whitelist' "${TMPFILE}7" > "${TMPFILE}9"
    # write the user's hosts.local to head, then the blacklists
    cat "${HOSTSDIR}"/hosts.local > "${OUTPUTFILE}"
    cat "${TMPFILE}9" >> "${OUTPUTFILE}"
    echo -e "# end of file" >> "${OUTPUTFILE}"
    # move to /etc/hosts
    mv "${OUTPUTFILE}" /etc/hosts
    # delete temporary directory
    rm -r -f "${TMPDIR}"
    hosts.local
    # /etc/hosts: static lookup table for host names
    #<ip> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost YOURHOSTSNAMEHERE
    ::1 localhost.localdomain localhost YOURHOSTSNAMEHERE
    # YOUR PERSONAL list
    # blocked list
    Create an alias in your ~/.bashrc
    alias hu='sudo /root/.hostsupdate/hosts_update'
    Run
    # hu <enter>
    Script and cache must be located in /root/.hostsupdate or modify scrip accordingly
    Cheers.
    Last edited by ontobelli (2012-02-15 09:15:17)

  • RG1 is not Updating Automatically

    Dear All Salute !!
    RG1 is not updating automatically in the system due to data migration on cutoff date since February; they are maintaining parallel in the legacy system (in Excel or any other), though here is updated project from 5.0 to 6.0.
    I am unable to understand, how the system is going on in the lacking of this.
    From Accounts Department side: Still Cenvat duty posting & statement (57AE) are done manually by dispatch/stores department. As per ECC6, system generated report should be available to the end users to avoid duplicate work & mistake.
    As per observation from SD side _no Opening Balance is uploaded while data migration_.
    I have got information through SDN about table J_2IRG1BAL but I am unaware of using this.
    Please provide me complete solution for this to do the needful instead of OSS Notes. 
    Rgds
    Srivastav
    +91-9973504950

    Adding to Komals reply,
    Please go through the sap note 951955 and check below comments:
    Please check whether you have maintained opening balances for
    all RG1 material in table J_2IRG1BAL. If not, please maintain opening
    balances for all RG1 material in J_2IRG1BAL for the date from which
    you want to run the RG1 report.
    Thanks
    Murtuza

  • Check for itunes updates automatically

    Hi I'd like to roll itunes 7.02 out to my business users as we intend to deliver work related content via podcasts, but I'd like to standardise on a version.
    Is there anyway to uncheck the "check for itunes updates automatically" in the general preferences via the registry?
    I have looked can can't locate this setting but it must be there somewhere.
    Thanks in advance

    You have Synergy running? What happens when you don't have it running?
    Any utility, whether a widget, an application or whatever, that controls or gets status from iTunes has the potential to launch iTunes when you don't expect. The developers try to ensure it doesn't happen but it can still happen.

  • Will Flash player update automatically? I have that box checked.

    I have a Mac Book Air 13" 2011 running Lion 10.7.5
    I checked the Automatic Update Flash Player box in the Flash in System preferences.
    Will it update automatically 30 days after the new Flash update 11.800etc.
    I read on the internet that if you check that box it will update automatically in the background.

    Mendel 1
    I appreciate your trying to help, but I was under the impression that it would update without going to their website.
    When I click on download and install it opens Safari and takes me to their website.
    The last time all I had to do was go to systems preference, click on Flash and in a few clicks it did it automatically without ay trouble at all.
    I didn't have to open a disc image or anything  it seemed to do it automatically in the background.
    I read that if you check the update automatically in the Flash Preferences it would cotinue to do this seamless update. 
    I also read that after 30 days after the new update, it would do it automatically, (if you hadn't done it from the website.)
    Is that not the case anymore?

  • In the command line how do I find the etc/host file? is there one?

    I am trying to work remotely and use our lotus notes system (which is from a windows based server) but I have to connect to the mail server and our IT person wants to find the equivalent of the Windows host file or host table . is there such a file? we went here
    http://linux.die.net/man/5/hosts
    hosts(5) - Linux man page
    Name
    hosts - The static table lookup for host names
    Synopsis
    /etc/hosts
    thanks

    Since you're using a Macintosh, quit reviewing linux stuff. These, when entered in the Terminal app (inside /Applications/Utilities/) should point you in the right direction:
    *cat /etc/hosts*
    details in:
    *man hosts*
    FWIW, you should search the Unix forum (or post your query there) under OS X Technologies.

Maybe you are looking for

  • How to make the new drawing line on the old form?

    I have been reading about Java about 2 months, and now I have to start my first project within this week. I still don't know how to do it!!! I have to get the info from the keyboard to draw a line on the old form of the original project. Please tell

  • Install OS X on replacement macbook air HD from Lion

    Hi, My Macbook air hard drive recently gave up after 4 years (therefore out of warranty) so I bought a replacement hard drive for it. At the time I was running snow leopard on my imac and understood I could use it's optical drive to install snow leop

  • ICloud crashing system preferences

    Installed the 10.7.2 update this morning on both my iMac (Mid 2007) and MacBook (Late 2008) and everytime I try to open the iCloud preference pane it crashes. Activity monitor shows system prefrences is using loads of CPU and memory resources and the

  • How to use VM server's disk space to store VM?

    Hi! I've installed Oracle VM Server on my Sun Server. The server has 4 hard drives, which are combined in RAID 10. The final disk space is approximately 600 gigabytes. This is df command's output: Filesystem Size  Used Avail Use% Mounted on /dev/sda2

  • Should a list of updated apps remain on the Updates page?

    Before ios 7, as soon as an app would update, the icon and any mention of the update would disappear from the Updates page.  Now there is a list there of all the apps that have updated since I installed ios 7.  The list is organized by date with head