From owner-freebsd-questions@freebsd.org Sat Aug 6 20:16:22 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E8DEBB1C2C for ; Sat, 6 Aug 2016 20:16:22 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0EFCE1C36 for ; Sat, 6 Aug 2016 20:16:21 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u76KGECk009490 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sat, 6 Aug 2016 13:16:15 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190] claimed to be yuri.doctorlan.com Subject: Re: Any way to cache large /etc/hosts files? To: FreeBSD - References: <00938E41-D041-48E6-A561-24AC721D0C42@mac.com> From: Yuri Message-ID: <67d4a340-30b2-d720-fb54-afa36931a3c5@rawbw.com> Date: Sat, 6 Aug 2016 13:16:13 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <00938E41-D041-48E6-A561-24AC721D0C42@mac.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2016 20:16:22 -0000 On 08/05/2016 11:45, Charles Swiger wrote: > > Take a look into DNS RPZ, aka DNS blacklisting (the common use case): > > https://dnsrpz.info > > Recent versions of ISC BIND support this.... Charles, Thanks for the DNS RPZ reference, it should work. However, a simpler solution along the lines of nsswitch.conf/nscd could also be of value. It is be possible to create a program that would load the list of "bad" domains directly into nscd. However, it looks like /var/run/nscd socket is only accessible through the private functions in libc. I couldn't find any python binding for example. Maybe it makes sense to create such binding. Yuri