[arch-general] dnsmasq w/ad-blocking hosts file (was NTP: Possible permissions bug)

Carl Schaefer schaefer at trilug.org
Sat May 10 12:41:36 EDT 2014

On Fri, 2014-05-09 at 18:34 +0200, luc.linux at mailoo.org wrote:
> To cache your values of /etc/hosts, you can install a dns server locally
> (like dnsmasq). That way, dns resolution of cached values are nearly
> instantaneous, and you can have a lot of dns rules. I have an /etc/hosts
> of 16M, and yet I have a really fast DNS resolution.

thanks, that looks like a good solution.  This is what I ended up doing:

. revert /etc/hosts to local definitions
. download the ad-blocker hosts file to /etc/hosts-adblock
. install dnsmasq, and add to /etc/dnsmasq.conf:
. remove "hosts" from /etc/host.conf

Also, since my machine doesn't travel:
. add "nohook resolv.conf" to /etc/dhcpcd.conf
. put "nameserver" in /etc/resolv.conf
. add to /etc/dnsmasq.conf

I haven't set this up on a laptop yet, but I imagine that would be more
complicated because sometimes the google DNS servers will be
inaccessible (e.g. hotel wifi).  Using OpenDNS on port 5353 might be a
good alternative.

More information about the arch-general mailing list