# bind reload

## col

How are your suppose to reload your bind zonefiles gracefully. I have tried:

/etc/init.d/named reload

but this doesnt seem to reload my zone files.?

----------

## sisyphus

This should help:

http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ref-guide/s1-bind-rndc.html

rndc is your friend.

----------

## col

ok but why doesnt 

/etc/init.d/named reload

or

/etc/init.d/named restart

work.....is it a bad ebuild /bug ?

----------

## sisyphus

Could you cat the contents of /etc/init.d/named and post it here?

----------

## col

also stop / start doesnt work....I run bind in chroot.

#!/sbin/runscript

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# $Header: /home/cvsroot/gentoo-x86/net-dns/bind/files/named.rc6,v 1.6 2002/10/12 21:25:49 woodchip Exp $

opts="start stop reload restart"

depend() {

        need net

        provide dns

}

checkconfig() {

        if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then

                eerror "No ${CHROOT}/etc/bind/named.conf file exists!"

        fi

        # In case someone doesn't have $CPU set from /etc/conf.d/named

        if [ ! $CPU ] ; then

                CPU=1

        fi

        if [ $CHROOT -a -d $CHROOT ] ; then

                PIDFILE="${CHROOT}/var/run/named/named.pid"

                KEY="${CHROOT}/etc/bind/rndc.key"

        else

                PIDFILE="/var/run/named/named.pid"

                KEY="/etc/bind/rndc.key"

        fi

}

start() {

        ebegin "Starting ${CHROOT:+chrooted }named"

        checkconfig || return 1

        start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT}

        eend $?

}

stop() {

        ebegin "Stopping named"

        checkconfig || return 2

        start-stop-daemon --stop --quiet --pidfile $PIDFILE

        eend $?

}

reload() {

        checkconfig || return 3

        if [ ! -f $PIDFILE ] ; then

                /etc/init.d/named start &>/dev/null

                exit

        fi

        if [ -f $KEY ] ; then

                ebegin "Reloading named"

                rndc -k $KEY reconfig &>/dev/null

                eend $?

        else /etc/init.d/named restart &>/dev/null

        fi

}

----------

## sisyphus

remove all the pipes to /dev/null (back up the file somewhere else first) and tyr rerunning. See if you get any error messages.

----------

## col

hmmmm it works now...thanks

----------

## sisyphus

Are you sure it wasn't working all along but that messages saying so were being suppressed?

Glad to hear you're sorted.

 :Smile: 

----------

## col

it definitely was not loading changes to my zone file. also when I did init.d/restart I got [!!] instead of [ok] ... I now get [ok] with restart but I still need to test this make sure I am not getting a false [ok]

----------

