From owner-freebsd-questions@FreeBSD.ORG Mon Jul 30 13:40:30 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 AE46116A41B for ; Mon, 30 Jul 2007 13:40:30 +0000 (UTC) (envelope-from lreid@cs.okstate.edu) Received: from a.cs.okstate.edu (a.cs.okstate.edu [139.78.113.1]) by mx1.freebsd.org (Postfix) with ESMTP id 931BB13C469 for ; Mon, 30 Jul 2007 13:40:30 +0000 (UTC) (envelope-from lreid@cs.okstate.edu) Received: from [172.18.0.137] (gw.tulsatech.org [70.168.226.134]) by a.cs.okstate.edu (Postfix) with ESMTP id 25C64A069B; Mon, 30 Jul 2007 08:40:29 -0500 (CDT) Message-ID: <46ADEA49.4010609@cs.okstate.edu> Date: Mon, 30 Jul 2007 08:40:25 -0500 From: Reid Linnemann User-Agent: Thunderbird 2.0.0.0 (X11/20070615) MIME-Version: 1.0 To: Patrick Dung References: <783850.98118.qm@web54303.mail.re2.yahoo.com> In-Reply-To: <783850.98118.qm@web54303.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions Subject: Re: ISC bind9 with dynamic DNS update (chroot problem) 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: Mon, 30 Jul 2007 13:40:30 -0000 Written by Patrick Dung on 07/28/07 10:52>> > Thanks for reply. > > Yes, your method works. > But I wonder why /var/named/etc/named/master directory permission > always reset to root at starting the daemon. > > Regards > Patrick > > --- Reid Linnemann wrote: > >> Written by Patrick Dung on 07/27/07 08:19>> >>> Hi >>> >>> I use FreeBSD 6.2 and the base bind9. >>> For dynamic DNS update, bind9 automatically generate the journal >> file >>> (end in .jnl). >>> The default config is to use chroot and the running user as 'bind'. >>> >>> The problem is that after named is started (/etc/init.d/named >> start), >>> the default chroot directory /var/named/etc/named permission will >> be >>> reset to own by root. So the named daemon (run as user 'bind') >> cannot >>> create the journal file and complain: >>> >>> Jul 27 21:06:54 fbsd62 named[2862]: general: localdomain.db.jnl: >>> create: permission denied >>> >>> One temp fix is to use chroot and run as root, any suggestions? >>> >>> Regards >>> Patrick >>> >>> >> When I did ddns, I had my dynamic zone files in a subdirectory off of >> >> the named chroot- i.e. /var/named/etc/namedb/dynamic - and chowned it >> to >> bind, allowing the bind user to read/write anything inside. >> I forgot to CC: questions@ on my original reply This is because /etc/rc.d/named auto-updates the chroot to an expected state defined by the mtree at /etc/mtree/BIND.chroot.dist P.S. Please do not top post, so the conversation order progresses from oldest to newest. -Reid