Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 02-26-2019, 05:48 PM   #1
Senior Member
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
hp-hosts hosts file format change

Anyone who uses the hosts file from hp-hosts ( to block bad/ad sites may have noticed that they no longer release a single consolidated file.

I have created a simple script to download the individual lists and create a single file suitable for using/adding to your Slackware hosts file. The script can also be used to generate a "generic" hosts file with only the domains to use on any distro.

By default it will download and use all the lists available and generate a hosts file using There are a couple of options that can be changed, make sure to read about them in the script itself.

If you use a default hosts file as provided by the Slackware installation, you can build the hosts file with the script using the default settings and just replace the current one in /etc (as root of course). The script itself can be ran as a regular user, but replacing the hosts file will require superuser privileges.

As of today (2019-02-26) the generated list has 559,674 hosts listed, and is ~17MB using the default settings.

Feedback, tweaks, fixes, suggestions are always welcome.

You can get the script here:



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to 'include file' in hosts.allow or hosts.deny? arfon Linux - Security 8 01-19-2018 10:54 PM
[SOLVED] change one time format to other format himu3118 Linux - Newbie 4 06-21-2010 08:29 AM
Hostname defined in file "network" changes after change to file "hosts" qwkfish Linux - Networking 2 10-14-2009 05:07 PM
Apache - how to change log format in Virtual Hosts ? dlugasx Linux - Server 2 10-08-2009 09:42 AM
does the /etc/hosts file work same as the M$ hosts file? Lleb_KCir Linux - Software 6 04-03-2004 05:33 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration