Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
08-13-2014, 06:46 PM
|
#1
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Rep:
|
hostsblock 0.12.3 (slackbuilds): it did not modify /etc/hosts.
Hi: this is Slackware 14.0. I downloaded the hostsblock 0.12.3 (ad blocking software) from Slackbuilds (which is for 14.1) created the tarball and installpkg'ed it. It should have modified /etc/hosts and copied the original to /etc/hostsblock/hosts.head. But it only copied the one onto the other. Did he think /etc/hosts was alright already?
Code:
bill@server:~/HOSTSBLOCK$ cat /etc/hosts
#
# 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. Just add the names, addresses
# and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#
# For loopbacking.
127.0.0.1 localhost
192.168.1.123 server.DN1 server
192.168.1.124 local.DN2 local
# End of hosts.
bill@server:~/HOSTSBLOCK$
Was he fooled by 14.0?
|
|
|
08-14-2014, 12:00 AM
|
#2
|
Member
Registered: Apr 2011
Location: British Columbia, Canada
Posts: 304
Rep:
|
Check that /etc/hostsblock/rc.conf is configured correctly and see if /var/log/hostsblock.log contains any information.
|
|
|
08-14-2014, 10:24 AM
|
#3
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
I read this which I hadn't:
Code:
bill@server:/etc/hostsblock$ head -n18 rc.conf
############################## NOTES FOR THE USER ##############################
# CRON. To run this utility as a cronjob, either symlink it as root by invoking
# "ln -sf /usr/sbin/hostsblock /etc/cron.weekly/hostsblock" (or change
# "cron.weekly" to the appropriate time period) or use "crontab -e" to have cron
# manually run the program. Make sure to run this utility yourself first to make
# sure it operates properly.
#
# DNSMASQ. It is suggested that users make use of a dns caching daemon like
# dnsmasq. See https://wiki.archlinux.org/index.php/Dnsmasq#DNS_Cache_Setup for
# directions. The default settings assume that you will be using dnsmasq. Make
# sure you add "addn-hosts=/etc/hosts.block" in dnsmasq, where /etc/hosts.block
# is your final hosts file (see the "hostsfile" variable).
#
# IF NOT USING DNSMASQ. If you decide not to use a dns caching daemon like
# dnsmasq, you will have to use the default system hosts file /etc/hosts. Make
# sure to copy your original to /etc/hostsblock/hosts.head to include your
# original entries, e.g. local loopback. This file will also include commented
# out alternative settings for this scenario.
bill@server:/etc/hostsblock$
My case it that of not having the dnsmasq daemon running. I'll first do: '/usr/sbin/hostsblock' as everything in /etc/hostsblock/rc.conf seems to be well setup. For instance my not having dnsmasq seems to have taken into account. On the other hand I have these two sections:
Code:
# FINAL HOSTSFILE. The final hosts file that combines together all downloaded
# blocklists. If not using a dns caching daemon like dnsmasq, this should be
# /etc/hosts. Include hosts file entries which you want to maintain in the
# "hostshead" entry, such as your loopback device (e.g. 127.0.0.1 localhosts)
hostsfile="/etc/hosts" # If not using a dns caching daemon
Code:
# HEAD FILE. File containing hosts file entries which you want at the beginning
# of the resultant hosts file, e.g. for loopback devices and IPV6 entries. Use
# your original /etc/hosts file here if you are writing your final blocklist to
# /etc/hosts so as to preserve your loopback devices. Give hostshead="0" to
# disable this feature. For those targeting /etc/hosts, it is advisable to copy
# their old /etc/hosts file to this file so as to preserve existing entries.
hostshead="/etc/hostsblock/hosts.head" # If not using dns caching.
So it seems I have nothing else to do, except 'ln -sf /usr/sbin/hostsblock /etc/cron.weekly/hostsblock'. Thanks for your reply.
EDIT: still it does not modify /etc/hosts. The log file:
Code:
bill@server:/etc/hostsblock$ cat /var/log/hostsblock.log
Hostsblock started at 08/14/2014 12:30:06
Checking blocklists for updates...
http://winhelp2002.mvps.org/hosts.zip...UPDATED
http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&mimetype=plaintext...UPDATED
http://hosts-file.net/download/hosts.zip...UPDATED
http://www.malwaredomainlist.com/hostslist/hosts.txt...UPDATED
http://hosts-file.net/ad_servers.asp...UPDATED
http://hosts-file.net/hphosts-partial.asp...UPDATED
http://hostsfile.mine.nu/Hosts.zip...UPDATED
http://someonewhocares.org/hosts/hosts...UPDATED
http://sysctl.org/cameleon/hosts...UPDATED
http://www.ismeh.com/HOSTS...FAILED
Script exiting @ 08/14/2014 12:30:40bill@server:/etc/hostsblock$
Last edited by stf92; 08-14-2014 at 10:50 AM.
|
|
|
08-14-2014, 10:30 AM
|
#4
|
Member
Registered: Apr 2011
Location: British Columbia, Canada
Posts: 304
Rep:
|
hostshead should contain your original /etc/hosts so that hostsblock can use it to generate your new hosts file.
|
|
|
08-14-2014, 12:26 PM
|
#5
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Yes I know. But new entries in /etc/hosts should appear as hostsblock is run. I don't see any new entry.
|
|
|
09-17-2014, 05:13 PM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,415
|
OT / FWIW using /etc/hosts for redirecting lookups like that is a crude, past millennium way of dealing with things.
|
|
|
09-17-2014, 05:50 PM
|
#7
|
Member
Registered: Apr 2011
Location: British Columbia, Canada
Posts: 304
Rep:
|
unSpawn, suggestions?
|
|
|
09-17-2014, 05:59 PM
|
#8
|
Moderator
Registered: May 2001
Posts: 29,415
|
Thanks for asking. For effective, usable and efficient distro and browser-agnostic filtering you can't beat a filtering proxy. Then you can block the stuff mentioned for example here: https://www.linuxquestions.org/quest...9/#post3585760
|
|
|
09-17-2014, 06:54 PM
|
#9
|
Member
Registered: Apr 2011
Location: British Columbia, Canada
Posts: 304
Rep:
|
I spent a long time running Privoxy. It works quite well but requires the overhead of maintenance and tuning, in addition to attention to enforce that programs adhere to proxy settings (desktop or env var). I also use blocks like RequestPolicy and cookie management on my primary browser, but because I am running multiple browsers for >1 accounts on my system, I do not wish to rely on these for the main blocking workload.
For me a hosts file is simple and effective.
|
|
|
All times are GMT -5. The time now is 10:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|