NAMED wont operate

Discussion in 'Installation/Configuration' started by crypted, Aug 16, 2008.

  1. crypted

    crypted Member

    After upgrading ISPConfig to the latest version, my NAMED seems to have broke. I have been able to get it to work by writing it in the prompt, however my server seems to keep rebooting so if I'm not around DNS never gets reactivated...

    When I start it via "/etc/init.d/named start" the following occurs:
    Code:
    [dingle@its init.d]# ./named start
    Starting named: 
    Error in named configuration:
    zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
    zone 53.110.65.in-addr.arpa/IN: loaded serial 2008081502
    zone 57.110.65.in-addr.arpa/IN: loaded serial 2008081502
    zone 36.157.66.in-addr.arpa/IN: loaded serial 2008081502
    pri.kissland.com:9: NS record '65.110.53.130.' appears to be an address
    pri.kissland.com:10: NS record '65.110.53.131.' appears to be an address
    zone kissland.com/IN: loaded serial 2008012703
    pri.derekgordon.com:9: NS record '65.110.53.130.' appears to be an address
    pri.derekgordon.com:10: NS record '65.110.53.131.' appears to be an address
    zone derekgordon.com/IN: loaded serial 2008012706
    pri.uaphigam.com:9: NS record '65.110.53.130.' appears to be an address
    pri.uaphigam.com:10: NS record '65.110.53.131.' appears to be an address
    zone uaphigam.com/IN: loaded serial 2008012801
    pri.inter5.org:9: NS record '65.110.53.130.' appears to be an address
    pri.inter5.org:10: NS record '65.110.53.131.' appears to be an address
    zone inter5.org/IN: loaded serial 2008060607
    pri.areyouliberal.com:9: NS record '65.110.53.130.' appears to be an address
    pri.areyouliberal.com:10: NS record '65.110.53.131.' appears to be an address
    zone areyouliberal.com/IN: loaded serial 2008012702
    pri.stalkerspub.com:9: NS record '65.110.53.130.' appears to be an address
    pri.stalkerspub.com:10: NS record '65.110.53.131.' appears to be an address
    zone stalkerspub.com/IN: loaded serial 2008012702
    pri.wdfoxtrotters.net:9: NS record '65.110.53.130.' appears to be an address
    pri.wdfoxtrotters.net:10: NS record '65.110.53.131.' appears to be an address
    zone wdfoxtrotters.net/IN: loaded serial 2008012702
    pri.cupfiji.com:9: NS record '65.110.53.130.' appears to be an address
    pri.cupfiji.com:10: NS record '65.110.53.131.' appears to be an address
    zone cupfiji.com/IN: loaded serial 2008012702
    pri.proconsolutions.com:9: NS record '65.110.53.130.' appears to be an address
    pri.proconsolutions.com:10: NS record '65.110.53.131.' appears to be an address
    zone proconsolutions.com/IN: loaded serial 2008012702
    zone layrisson.com/IN: loaded serial 2008062001
    zone X-ESS.ORG/IN: loaded serial 2008081507
    [FAILED]
    [dingle@its init.d]# 
    The only way that NAMED will be started is like I said, via SSH command prompt when I type "/usr/sbin/named -u named -t /var/named/chroot."

    Any idea how to fix this so that the standard NAMED script will work and so ISPCONFIG can once again control NAMED to keep it all operational?

    Thanks a lot!!!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you install a named update too? If you, please check that the permissions of the chroot directory are identical to the ones described in the perfect setup guide.

    Additionally, please post the content of one of the files were bind gives the error "appears to be an address" for.
     
  3. crypted

    crypted Member

    I've gone through the ISPConfig steps for setting up NAMED again. That did not fix the situation and the same error occurs.

    -rwxr-x--- 2 root root 369K Jul 11 20:27 /usr/sbin/named

    drwxr-x--- 6 root named 4.0K Jul 11 20:27 chroot

    The internal code of the ZONE files is as follows:
    Code:
    $TTL        2500
    @       IN      SOA     65.110.53.130. admin.derekgordon.com. (
                            2008012706       ; serial, todays date + todays serial #
                            28800              ; refresh, seconds
                            7200              ; retry, seconds
                            604800              ; expire, seconds
                            2500 )            ; minimum, seconds
    ;
                    NS      65.110.53.130.              ; Inet Address of name server 1
                    NS      65.110.53.131.              ; Inet Address of name server 2
    ;
    
    derekgordon.com  MX      10 mail.
      MX      10 www.inter5.org.
    
    derekgordon.com.      A        65.110.53.134
    www       A       65.110.53.134
    jill       A       65.110.53.134
    old       A       65.110.53.134
    dev       A       65.110.53.133
    dev2       A       65.110.53.134
    peru       A       65.110.53.137
    mail       A       65.110.53.131
    
    irc       CNAME  irc.intrac.net.
    
    derekgordon.com.       TXT  "v=spf1 a mx ptr ~all"
    
    ;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
    
    Code:
    $TTL        8700
    @       IN      SOA     65.110.53.130. admin.inter5.org. (
                            2008060607       ; serial, todays date + todays serial #
                            28800              ; refresh, seconds
                            7200              ; retry, seconds
                            604800              ; expire, seconds
                            8700 )            ; minimum, seconds
    ;
                    NS      65.110.53.130.              ; Inet Address of name server 1
                    NS      65.110.53.131.              ; Inet Address of name server 2
    ;
    
    www  MX      10 www.inter5.org.
      MX      10 www.inter5.org.
    
    inter5.org.      A        65.110.53.135
    www       A       65.110.53.135
    voiceserver       A       65.110.53.131
    voice       A       65.110.53.131
    mail       A       65.110.53.130
    ns5       A       65.110.53.130
    ns6       A       65.110.53.131
    ns7       A       65.110.53.132
    its       A       65.110.53.130
    webmail    A        65.110.53.135 
    
    inter5.org.       TXT  "v=spf1 a mx ptr ~all"
    
    ;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
    
    The NAMED file in INIT.D looks like this:
    Code:
    #!/bin/bash
    #
    # named           This shell script takes care of starting and stopping
    #                 named (BIND DNS server).
    #
    # chkconfig: - 13 87
    # description: named (BIND) is a Domain Name Server (DNS) \
    # that is used to resolve host names to IP addresses.
    # probe: true
    
    # Source function library.
    . /etc/rc.d/init.d/functions
    
    # Source networking configuration.
    [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
    
    [ -r /etc/sysconfig/named ] && . /etc/sysconfig/named
    
    export KRB5_KTNAME=${KEYTAB_FILE:-/etc/named.keytab}
    
    # Don't kill named during clean-up
    NAMED_SHUTDOWN_TIMEOUT=${NAMED_SHUTDOWN_TIMEOUT:-100}
    
    if [ -n "$ROOTDIR" ]; then
       ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`;
       rdl=`/usr/bin/readlink $ROOTDIR`;
       if [ -n "$rdl" ]; then
          ROOTDIR="$rdl";
       fi;
    fi
    
    RETVAL=0
    named='named'
    if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/sbin/named_sdb ]; then
        named='named_sdb';
    fi;
    prog=$named
    
    nmdcOption()
    { let i=0; 
      for a in $*; 
      do ((++i)); 
         if [ $a = -c ]; then 
             ((++i)); 
             eval 'echo $'$i;
         elif [[ $a = -c* ]]; then 
             echo ${a#-c}; 
         fi; 
      done; 
    }
    
    named_c_option=`nmdcOption $OPTIONS`;
    named_conf=${named_c_option:-/etc/named.conf};
    
    dbusEnabled=0;
    for a in $OPTIONS; do
        if [ $a  = "-D" ]; then
            dbusEnabled=1;
        fi;
    done
    
    if [ $dbusEnabled -eq 0 ] && [ -z "$DISABLE_NAMED_DBUS" ] ; then
        NetworkManagerEnabled=0
        for l in 0 1 2 3 4 5 6; do 
            if /sbin/chkconfig --level=$l NetworkManager >/dev/null 2>&1; then 
                NetworkManagerEnabled=1; 
            fi; 
        done
        if [ $NetworkManagerEnabled -eq 1 ]; then
            OPTIONS="$OPTIONS -D";
        fi;
        dbusEnabled=1;
    fi
    
    start() {
    
            [ -x /usr/sbin/$named ] || exit 5
    
            if [ ! -r ${ROOTDIR}${named_conf} ] ; then
               if [ -z "$named_c_option" ] && [ -r ${ROOTDIR}/etc/named.caching-nameserver.conf ]; then
                   named_conf='/etc/named.caching-nameserver.conf';
                   OPTIONS="$OPTIONS -c ${named_conf}";
               else
                   echo Locating $ROOTDIR/${named_conf} failed:
                   failure
                   echo;
                   exit 6;
               fi;
            fi;
    
            # Start daemons.
            echo -n $"Starting $named: "
            if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
                    echo -n $"$named: already running"
                    failure
                    echo
                    return 1
            fi
            ckcf_options='-z'; # enable named-checkzone for each zone (9.3.1+) !
            if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
                    OPTIONS="${OPTIONS} -t ${ROOTDIR}"
                    ckcf_options="$ckcf_options -t ${ROOTDIR}";
                    if [ -s /etc/localtime ]; then
                        cp -fp /etc/localtime ${ROOTDIR}/etc/localtime
                    fi;
                    if [ ! -d ${ROOTDIR}/proc ]; then
                        mkdir -p ${ROOTDIR}/proc
                    fi
                    if ! egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
                        mount --bind -n /proc ${ROOTDIR}/proc >/dev/null 2>&1 
                    fi
                    if [ $dbusEnabled -eq 1 ]; then
                        if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
                            mkdir -p ${ROOTDIR}/var/run/dbus
                            if [ ! -d  /var/run/dbus ] ; then
                                mkdir -p /var/run/dbus ;
                            fi;
                            mount --bind -n /var/run/dbus ${ROOTDIR}/var/run/dbus > /dev/null 2>&1;
                        fi;             
                    fi;
            fi
            no_write_master_zones=0
            if [ -e /etc/selinux/config ]; then
               .  /etc/selinux/config
               if [[ ( "$SELINUX" != 'disabled') && ("$SELINUXTYPE" != "") && (-d /etc/selinux/${SELINUXTYPE}) && (-e /etc/selinux/${SELINUXTYPE}/booleans || (-e /etc/selinux/${SELINUXTYPE}/booleans.local)) ]]; then
                   if [ -e /etc/selinux/${SELINUXTYPE}/booleans.local ]; then
                       . /etc/selinux/${SELINUXTYPE}/booleans.local;
                   else
                       . /etc/selinux/${SELINUXTYPE}/booleans;
                   fi;
                   if echo "$named_write_master_zones" | /bin/egrep -q '^[0-9]+$'; then
                       if [ "$named_write_master_zones" -eq 1 ] ; then
                           /bin/chown -f --from=root:named named:named $ROOTDIR/var/named
                       elif [ "$named_write_master_zones" -eq 0 ] ; then
                           /bin/chown -f --from=named:named root:named $ROOTDIR/var/named
                       fi;
                   fi;
               else
                   no_write_master_zones=1
               fi;
            else
                no_write_master_zones=1
            fi;
            if [ "$no_write_master_zones" -eq 1 ]; then
                if [[ "$ENABLE_ZONE_WRITE" =  [yY1]* ]]; then
                    /bin/chown -f --from=root:named named:named $ROOTDIR/var/named
                elif [[ "$ENABLE_ZONE_WRITE" =  [nN0]* ]]; then             
                    /bin/chown -f --from=named:named root:named $ROOTDIR/var/named
                fi;
            fi
            conf_ok=0;
            if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
               conf_ok=1;
            else
               RETVAL=$?;
            fi
            if [ $conf_ok -eq 1 ]; then        
               daemon /usr/sbin/$named -u named ${OPTIONS};
               RETVAL=$?;
               if [ $RETVAL -eq 0 ]; then
                   rm -f /var/run/named.pid
                   rm -f /var/run/named_sdb.pid 2>/dev/null
                   ln -s $ROOTDIR/var/run/named/named.pid /var/run/named.pid;
                   if [ "$named" = "named_sdb" ]; then
                       ln -s $ROOTDIR/var/run/named/named.pid /var/run/named_sdb.pid;
                   fi;
               fi;
               if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
                   # Verify that named actually started (JM 2006-10-04)
                   if [ ! -e $ROOTDIR/var/run/named/named.pid ]; then
                      # If there is not a file containing the PID of the now running named daemon then create it (JM 2006-10-04)
                      echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named.pid;
                      if [ "$named" = "named_sdb" ]; then
                         echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named_sdb.pid;
                      fi;
                   fi;
               fi;
            else
               named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`";         
               echo
               echo $"Error in named configuration"':';
               echo "$named_err";
               failure
               echo
               if [ -x /usr/bin/logger ]; then
                   echo "$named_err" | /usr/bin/logger -pdaemon.error -tnamed 
               fi;
               return 7;
            fi;
            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/named 
            echo
            return $RETVAL
    }
    stop() {
            # Stop daemons.
            echo -n $"Stopping $named: "
            /usr/sbin/rndc stop >/dev/null 2>&1 
            RETVAL=$?
            [ "$RETVAL" -eq 0 ] || killproc "$named" -TERM >/dev/null 2>&1
    
            timeout=0
            RETVAL=0
            while /sbin/pidof -o %PPID "$named" >/dev/null; do
                    if [ $timeout -ge $NAMED_SHUTDOWN_TIMEOUT ]; then
                            RETVAL=1
                            break
                    else
                            sleep 2 && echo -n "."
                            timeout=$((timeout+2))
                    fi;
            done
            if [ $RETVAL -eq 0 ]; then
                rm -f /var/lock/subsys/named
                rm -f /var/run/named.pid
                rm -f /var/run/named_sdb.pid 2>/dev/null        
            fi;
            if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
                if egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
                   umount ${ROOTDIR}/proc >/dev/null 2>&1
                fi
                if [ $dbusEnabled -eq 1 ]; then
                   if egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
                      umount ${ROOTDIR}/var/run/dbus > /dev/null 2>&1
                   fi;
                fi;
            fi;
            if [ $RETVAL -eq 0 ]; then
                success
            else
                failure
            fi;
            echo
            return $RETVAL
    }
    rhstatus() {
            /usr/sbin/rndc status
            status /usr/sbin/$named
            return $?
    }
    restart() {
            stop
    # wait a couple of seconds for the named to finish closing down
            sleep 2
            start
    }
    reload() {
            echo -n $"Reloading $named: "
            p=`/sbin/pidof -o %PPID $named`
            RETVAL=$?
            if [ "$RETVAL" -eq 0 ]; then 
                /usr/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p;
                RETVAL=$?
            fi
            [ "$RETVAL" -eq 0 ] && success $"$named reload" || failure $"$named reload"
            echo
            return $?
    }
    probe() {
            # named knows how to reload intelligently; we don't want linuxconf
            # to offer to restart every time
            /usr/sbin/rndc reload >/dev/null 2>&1 || echo start
            return $?
    }
    checkconfig() {
            ckcf_options='-z'; # enable named-checkzone for each zone (9.3.1+) !
            if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
                    OPTIONS="${OPTIONS} -t ${ROOTDIR}"
                    ckcf_options="$ckcf_options -t ${ROOTDIR}";  
            fi;
            if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} | cat ; then
                return 0;
            else
                return 1;
            fi
    }
    
    # See how we were called.
    case "$1" in
            start)
                    start
                    ;;
            stop)
                    stop
                    ;;
            status)
                    rhstatus
                    ;;
            restart)
                    restart
                    ;;
            condrestart)
                    [ -e /var/lock/subsys/named ] && restart;
                    ;;
            reload)
                    reload
                    ;;
            probe)
                    probe
                    ;;
            checkconfig|configtest|check|test)
                    checkconfig
                    ;;
            *)
                    echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|configtest|probe}"
                    exit 2
    esac
    
    exit $?
    
    I'm not really seeing what's wrong, but then again I'm not that skilled!!!

    Thanks.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    You must not use IP addresses for NS records. Please use hostnames (like ns1.example.com) instead.
     
  5. crypted

    crypted Member

    Ahh. Know a method to quickly redo all of the files? There are well over 100 for me to go through. Thanks a lot though, ugh I feel like a tard for not seeing that!
     

Share This Page