From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 17:00:11 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D295E16A418 for ; Tue, 11 Dec 2007 17:00:11 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from galaxy.systems.pipex.net (galaxy.systems.pipex.net [62.241.162.31]) by mx1.freebsd.org (Postfix) with ESMTP id B887513C447 for ; Tue, 11 Dec 2007 17:00:10 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from [192.168.23.2] (62-31-10-181.cable.ubr05.edin.blueyonder.co.uk [62.31.10.181]) by galaxy.systems.pipex.net (Postfix) with ESMTP id BE908E0006A6; Tue, 11 Dec 2007 17:00:04 +0000 (GMT) Message-ID: <475EC215.8060004@dial.pipex.com> Date: Tue, 11 Dec 2007 17:00:05 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20061205 X-Accept-Language: en MIME-Version: 1.0 To: Erich Dollansky , freebsd-questions@freebsd.org References: <475E0190.7030909@pacific.net.sg> <200712111718.05876.nvass@teledomenet.gr> <475EAC9D.1020902@pacific.net.sg> <20071211084309.A16234@wonkity.com> <475EB887.6070902@pacific.net.sg> In-Reply-To: <475EB887.6070902@pacific.net.sg> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: performance impact of large /etc/hosts files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2007 17:00:11 -0000 Erich Dollansky wrote: > But new sites have new stuff I would like to be filtered out. To make > these experiences as rare as possible, I collect from friends and the > Internet hosts files to filter as much as possible. > > This resulted in a pretty large file meanwhile. > > But the Internet looks much more usable for me now. Assuming I've understood your initial post correctly, then I do the same, redirecting some dozen ad sites to a local web server. With a dozen or so aliases I've never noticed any difference in performance, but I suspect you have rather more than that :-) I could never quite be bothered to maintain the list once I'd filtered ads from the sites I use most often. I think the answer to your original question is going to be "look at the source code". If your hosts file is really that large then I suspect it will be having a performance effect and only you can judge if it's significant or not. Large hosts files are not the future, so performance improvements in the future are unlikely, I would say. I'm pretty sure you could also do the same with a local DNS server, if you wanted to "abuse" it in this way, and that would *probably* be faster since the code would expect to deal with large lists of hosts. Been a while since I did anything like that, though, and never on the scale you seem to be describing. There's no clean solutions to getting different lookups per-user that I am aware of, but unless your host is also performing some service that involves a lot of name resolution then why care? (And if it is, you shouldn't be using it as a general web browser :-)) Unclean solutions might include something like making the hosts file point to some automounted directory which changed per user, but you'd have to be sure that you saw a valid hosts file at boot time. Fiddling with symlinks in rc scripts could do that, I'm sure. --Alex