Changeset 8101


Ignore:
Timestamp:
May 30, 2010, 4:31:58 PM (14 years ago)
Author:
richardvm
Message:

Fixed reverse dns, no arpa zones where loaded

Location:
2.0/nanobsd/nanobsd/files/usr/local
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2.0/nanobsd/nanobsd/files/usr/local/etc/mararc

    r8025 r8101  
    1111
    1212csv2["wleiden.net."] = "db.wleiden.net"
     13csv2["16.172.in-addr.arpa."] = "db.16.172.in-addr.arpa."
     14csv2["17.172.in-addr.arpa."] = "db.17.172.in-addr.arpa."
     15csv2["18.172.in-addr.arpa."] = "db.18.172.in-addr.arpa."
     16csv2["19.172.in-addr.arpa."] = "db.19.172.in-addr.arpa."
     17csv2["20.172.in-addr.arpa."] = "db.20.172.in-addr.arpa."
     18csv2["21.172.in-addr.arpa."] = "db.21.172.in-addr.arpa."
     19csv2["22.172.in-addr.arpa."] = "db.22.172.in-addr.arpa."
     20csv2["23.172.in-addr.arpa."] = "db.23.172.in-addr.arpa."
     21csv2["24.172.in-addr.arpa."] = "db.24.172.in-addr.arpa."
     22csv2["25.172.in-addr.arpa."] = "db.25.172.in-addr.arpa."
     23csv2["26.172.in-addr.arpa."] = "db.26.172.in-addr.arpa."
     24csv2["27.172.in-addr.arpa."] = "db.27.172.in-addr.arpa."
     25csv2["28.172.in-addr.arpa."] = "db.28.172.in-addr.arpa."
     26csv2["29.172.in-addr.arpa."] = "db.29.172.in-addr.arpa."
     27csv2["30.172.in-addr.arpa."] = "db.30.172.in-addr.arpa."
     28csv2["31.172.in-addr.arpa."] = "db.31.172.in-addr.arpa."
    1329
    1430# The address this DNS server runs on.  If you want to bind
  • 2.0/nanobsd/nanobsd/files/usr/local/sbin/fetchzone.sh

    r7625 r8101  
    22
    33# Set some vars
    4 ZONE=wleiden.net
     4ZONES="wleiden.net 16.172.in-addr.arpa. 17.172.in-addr.arpa.
     518.172.in-addr.arpa. 19.172.in-addr.arpa. 20.172.in-addr.arpa.
     621.172.in-addr.arpa. 22.172.in-addr.arpa. 23.172.in-addr.arpa.
     724.172.in-addr.arpa. 25.172.in-addr.arpa. 26.172.in-addr.arpa.
     827.172.in-addr.arpa. 28.172.in-addr.arpa. 29.172.in-addr.arpa.
     930.172.in-addr.arpa. 31.172.in-addr.arpa."
     10
    511SERVER=195.169.86.131
    612APP=/usr/local/bin/fetchzone
    7 TMPFILE=/tmp/dns-${ZONE}.tmp
    8 REALFILE=/usr/local/etc/maradns/db.${ZONE}
    913LOGFILE=/var/log/fetchzone.log
    1014PIDFILE=/var/run/fetchzone.pid
     
    2024echo ${PID} > ${PIDFILE}
    2125
    22 # No zone file to compare with, so lets make a dummy
    23 touch ${REALFILE}
    24 
    2526# Tell logfile that I am starting
    2627log "[INFO] Fetchzone starting with PID: $PID"
     
    2930while [ true ]; do
    3031
    31   # Execute Fetchzone
    32   ${APP} ${ZONE} ${SERVER} > ${TMPFILE}
     32  # Run through multiple zones
     33  for ZONE in ${ZONES}
     34  do
    3335
    34   # Did Fetchzone exit unhappy
    35   if [ $? -eq 0 ]; then
     36    # (re) Set some extra vars
     37    TMPFILE=/tmp/dns-${ZONE}.tmp
     38    REALFILE=/usr/local/etc/maradns/db.${ZONE}
     39    # Execute Fetchzone
     40    ${APP} ${ZONE} ${SERVER} > ${TMPFILE}
     41 
     42    # Did Fetchzone exit unhappy
     43    if [ $? -eq 0 ]; then
     44 
     45      # Are there any changes?
     46      COMM=`comm -23 ${TMPFILE} ${REALFILE} 2>&1`
     47      if [ -n "$COMM" ]; then
     48 
     49        # If there are any changes copy tmp to realfile
     50        log "[INFO] Changes found"
     51        cp ${TMPFILE} ${REALFILE}
     52 
     53        # Maradns requires a restart to load new zonefile
     54        /usr/local/etc/rc.d/maradns restart
     55 
     56      fi
     57    else
     58 
     59      # Something went wrong lets log it
     60      log "[ERROR] Errors found in fetchzone query"
     61    fi
    3662
    37     # Are there any changes?
    38     COMM=`comm -23 ${TMPFILE} ${REALFILE}`
    39     if [ -n "$COMM" ]; then
    40 
    41       # If there are any changes copy tmp to realfile
    42       log "[INFO] Changes found"
    43       cp ${TMPFILE} ${REALFILE}
    44 
    45       # Maradns requires a restart to load new zonefile
    46       /usr/local/etc/rc.d/maradns restart
    47 
    48     fi
    49   else
    50 
    51     # Something went wrong lets log it
    52     log "[ERROR] Errors found in fetchzone query"
    53   fi
     63  done
    5464
    5565  # Lets go to sleep
    5666  sleep ${IDLE}
    5767done
     68
Note: See TracChangeset for help on using the changeset viewer.