update to 9.9.5.W1 [release 9.9.5.W1-1mamba;Sun Apr 13 2014]
This commit is contained in:
parent
273c4293ba
commit
55806a4b1c
@ -1,2 +1,5 @@
|
|||||||
# bind
|
# bind
|
||||||
|
|
||||||
|
BIND (Berkeley Internet Name Domain) is an implementation of the DNS (Domain Name System) protocols.
|
||||||
|
BIND includes a DNS server (named), which resolves host names to IP addresses; a resolver library (routines for applications to use when interfacing with DNS); and tools for verifying that the DNS server is operating properly.
|
||||||
|
|
||||||
|
17
bind-9.3.4-mktemp.patch
Normal file
17
bind-9.3.4-mktemp.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
--- bind-9.3.4/contrib/named-bootconf/named-bootconf.sh.orig 2007-06-05 09:25:23.000000000 +0200
|
||||||
|
+++ bind-9.3.4/contrib/named-bootconf/named-bootconf.sh 2007-06-05 09:27:48.000000000 +0200
|
||||||
|
@@ -54,11 +54,9 @@
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
if [ ${OPTIONFILE-X} = X ]; then
|
||||||
|
- WORKDIR=/tmp/`date +%s`.$$
|
||||||
|
- ( umask 077 ; mkdir $WORKDIR ) || {
|
||||||
|
- echo "unable to create work directory '$WORKDIR'" >&2
|
||||||
|
- exit 1
|
||||||
|
- }
|
||||||
|
+ WORKDIR=`mktemp -d /tmp/named-bootconf.XXXXXX` ||
|
||||||
|
+ { echo "unable to create work directory '$WORKDIR'" >&2; exit 1; }
|
||||||
|
+
|
||||||
|
OPTIONFILE=$WORKDIR/options
|
||||||
|
ZONEFILE=$WORKDIR/zones
|
||||||
|
COMMENTFILE=$WORKDIR/comments
|
168
bind-chroot.sh
Normal file
168
bind-chroot.sh
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# copyright Florin Grad <florin@mandrakesoft.com>
|
||||||
|
# GPL License
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
[ -f /etc/sysconfig/syslog ] && . /etc/sysconfig/syslog
|
||||||
|
|
||||||
|
[ -f /etc/sysconfig/named ] && . /etc/sysconfig/named
|
||||||
|
|
||||||
|
|
||||||
|
# chroot
|
||||||
|
if [ "$1" == "-s" -o "$1" == "--status" ]; then
|
||||||
|
|
||||||
|
if [ -n "${ROOTDIR}" ]; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "ROOTDIR is defined in your /etc/sysconfig/named file.\n"
|
||||||
|
gprintf "You already appear to have a chroot BIND setup.\n"
|
||||||
|
gprintf "ROOTDIR=${ROOTDIR}\n"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
gprintf "Your BIND server is not chrooted.\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$1" == "-c" -o "$1" == "--chroot" -o "$1" == "-i" -o "$1" == "--interactive" ]; then
|
||||||
|
|
||||||
|
if [ -n "${ROOTDIR}" ]; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "In your /etc/sysconfig/named file: ROOTDIR=${ROOTDIR} exists\n"
|
||||||
|
gprintf "You already appear to have a chroot BIND setup.\n"
|
||||||
|
exit
|
||||||
|
|
||||||
|
#interactive
|
||||||
|
elif [ "$1" == "-i" -o "$1" == "--interactive" ]; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Please enter the ROOTDIR path (ex: /var/lib/named-chroot):\n"
|
||||||
|
# can't use ctrl-c, we trap all signal.
|
||||||
|
read answer;
|
||||||
|
export ROOTDIR="$answer"
|
||||||
|
#non interactive
|
||||||
|
elif [ "$1" == "-c" -a -n "$2" -o "$1" == "--chroot" -a -n "$2" ]; then
|
||||||
|
export ROOTDIR="$2"
|
||||||
|
else
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Missing path for chroot.\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create directories and set permissions
|
||||||
|
mkdir -p ${ROOTDIR}
|
||||||
|
chmod 700 ${ROOTDIR}
|
||||||
|
cd ${ROOTDIR}
|
||||||
|
mkdir -p dev etc var/run
|
||||||
|
[ -e dev/null ] || mknod dev/null c 1 3
|
||||||
|
[ -e dev/random ] || mknod dev/random c 1 8
|
||||||
|
cp /etc/localtime etc/
|
||||||
|
[ -f /etc/named.conf ] && mv -f /etc/named.conf etc/
|
||||||
|
[ -f /etc/rndc.conf ] && mv -f /etc/rndc.conf etc/
|
||||||
|
[ -f /etc/rndc.key ] && mv -f /etc/rndc.key etc/
|
||||||
|
[ -e /var/named ] && mv -f /var/named var
|
||||||
|
[ -e /var/run/named/named.pid ] && mv -f /var/run/named var/run
|
||||||
|
chown -R named.named ${ROOTDIR}
|
||||||
|
|
||||||
|
# update /etc/sysconfig/syslog
|
||||||
|
if ! grep -q "${ROOTDIR}/dev/log" /etc/sysconfig/syslog; then
|
||||||
|
if ! grep -q ^SYSLOGD_OPTIONS= /etc/sysconfig/syslog; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nAdding SYSLOGD_OPTIONS in the /etc/sysconfig/syslog file.\n"
|
||||||
|
echo "SYSLOGD_OPTIONS=\"-a ${ROOTDIR}/dev/log\"" >> /etc/sysconfig/syslog
|
||||||
|
elif sed 's!^\(SYSLOGD_OPTIONS=".*\)"$!\1 -a '${ROOTDIR}'/dev/log"!' < /etc/sysconfig/syslog > /etc/sysconfig/syslog.new; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nUpdating SYSLOGD_OPTIONS in the /etc/sysconfig/syslog file.\n"
|
||||||
|
mv -f /etc/sysconfig/syslog.new /etc/sysconfig/syslog
|
||||||
|
else
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nWarning: Updating /etc/sysconfig/syslog failed! Continuing.\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#update the OPTIONS in /etc/sysconfig/named
|
||||||
|
if grep -q ^OPTIONS= /etc/sysconfig/named; then
|
||||||
|
if sed 's!^\(OPTIONS=".*\)"$!\1 -c /etc/named.conf"!' < /etc/sysconfig/named > /etc/sysconfig/named.new; then
|
||||||
|
mv -f /etc/sysconfig/named.new /etc/sysconfig/named
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
gprintf "\nUpdating OPTIONS in /etc/sysconfig/named\n"
|
||||||
|
gprintf "OPTIONS=\"-c /etc/named.conf\"\n" >> /etc/sysconfig/named
|
||||||
|
fi
|
||||||
|
|
||||||
|
#update the ROOTDIR in /etc/sysconfig/named
|
||||||
|
gprintf "\nUpdating ROOTDIR in /etc/sysconfig/named\n"
|
||||||
|
gprintf "ROOTDIR=\"${ROOTDIR}\"\n" >> /etc/sysconfig/named
|
||||||
|
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nChroot configuration for BIND is complete.\n"
|
||||||
|
gprintf "\nYou should review your ${ROOTDIR}/etc/named.conf\n"
|
||||||
|
gprintf "\nand make any necessary changes.\n"
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nRun \"/sbin/service named restart\" when you are done.\n"
|
||||||
|
gprintf "\n"
|
||||||
|
|
||||||
|
# unchroot
|
||||||
|
elif [ "$1" == "-u" -o "$1" == "--unchroot" ]; then
|
||||||
|
|
||||||
|
if ! grep -q "^ROOTDIR=" /etc/sysconfig/named; then
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Your bind is not currently chrooted\n"
|
||||||
|
gprintf "\n"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Removing ROOTDIR from /etc/sysconfig/named\n"
|
||||||
|
sed -e '/^\(ROOTDIR=".*\)"$/d' < /etc/sysconfig/named > /etc/sysconfig/named.new
|
||||||
|
mv -f /etc/sysconfig/named.new /etc/sysconfig/named
|
||||||
|
gprintf "Cleaning the OPTIONS in /etc/sysconfig/named\n"
|
||||||
|
sed -e 's|-c /etc/named.conf[ \t]*||' < /etc/sysconfig/named > /etc/sysconfig/named.new
|
||||||
|
mv -f /etc/sysconfig/named.new /etc/sysconfig/named
|
||||||
|
sed -e 's|[ \t][ \t]*"|"|' < /etc/sysconfig/named > /etc/sysconfig/named.new
|
||||||
|
mv -f /etc/sysconfig/named.new /etc/sysconfig/named
|
||||||
|
gprintf "Cleaning the SYSLOGD_OPTIONS in /etc/sysconfig/syslog\n"
|
||||||
|
sed -e 's|-a '${ROOTDIR}'/dev/log[ \t]*||' < /etc/sysconfig/syslog > /etc/sysconfig/syslog.new
|
||||||
|
mv -f /etc/sysconfig/syslog.new /etc/sysconfig/syslog
|
||||||
|
sed -e 's|[ \t][ \t]*"|"|' < /etc/sysconfig/syslog > /etc/sysconfig/syslog.new
|
||||||
|
mv -f /etc/sysconfig/syslog.new /etc/sysconfig/syslog
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Moving the following files to their original location :\n"
|
||||||
|
gprintf "/etc/named.conf\n"
|
||||||
|
gprintf "/etc/rndc.conf\n"
|
||||||
|
gprintf "/etc/rndc.key\n"
|
||||||
|
gprintf "/var/named/*\n"
|
||||||
|
gprintf "/var/run/named\n"
|
||||||
|
gprintf "/etc/named.conf\n"
|
||||||
|
[ -f /etc/named.conf ] || mv -f ${ROOTDIR}/etc/named.conf /etc/
|
||||||
|
[ -f /etc/rndc.conf ] || mv -f ${ROOTDIR}/etc/rndc.conf /etc/
|
||||||
|
[ -f /etc/rndc.key ] || mv -f ${ROOTDIR}/etc/rndc.key /etc/
|
||||||
|
[ -e /var/named ] || mv -f ${ROOTDIR}/var/named /var
|
||||||
|
[ -e /var/run/named ] || mv -f ${ROOTDIR}/var/run/named /var/run
|
||||||
|
[ -f /etc/named.conf ] && chown -R named.named /etc/named.conf
|
||||||
|
[ -f /etc/rndc.conf ] && chown -R named.named /etc/rndc.conf
|
||||||
|
[ -f /etc/rndc.key ] && chown -R named.named /etc/rndc.key
|
||||||
|
[ -e /var/named ] && chown -R named.named /var/named
|
||||||
|
[ -e /var/run/named ] && chown -R named.named /var/run/named
|
||||||
|
touch /var/run/named/named.pid
|
||||||
|
[ -f /var/run/named/named.pid ] && chown -R named.named /var/run/named
|
||||||
|
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "Removing the ${ROOTDIR}\n"
|
||||||
|
rm -rf ${ROOTDIR}
|
||||||
|
gprintf "\nYour bind server is not chrooted anymore."
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\nRun \"/sbin/service named restart\" when you are done.\n"
|
||||||
|
gprintf "\n"
|
||||||
|
|
||||||
|
#usage
|
||||||
|
else
|
||||||
|
gprintf "\nUsage: chroot_bind.sh [arguments]"
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\n\t-s, --status \t\t(current bind configuration type)"
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\narguments:"
|
||||||
|
gprintf "\n\t-i, --interactive \t(so you can choose your path)"
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\n\t-c, --chroot \t\t(default: /var/lib/named-chroot)"
|
||||||
|
gprintf "\n"
|
||||||
|
gprintf "\n\t-u, --unchroot \t\t(back to the original configuration)"
|
||||||
|
gprintf "\n"
|
||||||
|
fi
|
11
bind-localhost.zone
Normal file
11
bind-localhost.zone
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
$TTL 86400
|
||||||
|
$ORIGIN localhost.
|
||||||
|
@ 1D IN SOA @ root (
|
||||||
|
42 ; serial (d. adams)
|
||||||
|
3H ; refresh
|
||||||
|
15M ; retry
|
||||||
|
1W ; expiry
|
||||||
|
1D ) ; minimum
|
||||||
|
|
||||||
|
1D IN NS @
|
||||||
|
1D IN A 127.0.0.1
|
49
bind-named.conf
Normal file
49
bind-named.conf
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// generated by named-bootconf.pl
|
||||||
|
|
||||||
|
options {
|
||||||
|
directory "/var/named";
|
||||||
|
pid-file "/var/run/named/named.pid";
|
||||||
|
/*
|
||||||
|
* If there is a firewall between you and nameservers you want
|
||||||
|
* to talk to, you might need to uncomment the query-source
|
||||||
|
* directive below. Previous versions of BIND always asked
|
||||||
|
* questions using port 53, but BIND 8.1 uses an unprivileged
|
||||||
|
* port by default.
|
||||||
|
*/
|
||||||
|
// query-source address * port 53;
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// a caching only nameserver config
|
||||||
|
//
|
||||||
|
controls {
|
||||||
|
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
|
||||||
|
};
|
||||||
|
zone "." IN {
|
||||||
|
type hint;
|
||||||
|
file "named.ca";
|
||||||
|
};
|
||||||
|
|
||||||
|
zone "localhost" IN {
|
||||||
|
type master;
|
||||||
|
file "localhost.zone";
|
||||||
|
allow-update { none; };
|
||||||
|
};
|
||||||
|
|
||||||
|
#zone "in-qinet.it" IN {
|
||||||
|
# type master;
|
||||||
|
# file "in-qinet.zone";
|
||||||
|
# allow-update { localhost; };
|
||||||
|
#};
|
||||||
|
|
||||||
|
zone "0.0.127.in-addr.arpa" IN {
|
||||||
|
type master;
|
||||||
|
file "named.local";
|
||||||
|
allow-update { none; };
|
||||||
|
};
|
||||||
|
|
||||||
|
logging {
|
||||||
|
category lame-servers { null; };
|
||||||
|
};
|
||||||
|
|
||||||
|
include "/etc/rndc.key";
|
10
bind-named.local
Normal file
10
bind-named.local
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
$TTL 86400
|
||||||
|
@ IN SOA localhost. root.localhost. (
|
||||||
|
1997022700 ; Serial
|
||||||
|
28800 ; Refresh
|
||||||
|
14400 ; Retry
|
||||||
|
3600000 ; Expire
|
||||||
|
86400 ) ; Minimum
|
||||||
|
IN NS localhost.
|
||||||
|
|
||||||
|
1 IN PTR localhost.
|
33
bind-rndc.conf
Normal file
33
bind-rndc.conf
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||||
|
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||||
|
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||||
|
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* $Id: rndc.conf,v 1.7 2001/01/09 21:40:45 bwelling Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rndc configuration file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
options {
|
||||||
|
default-server localhost;
|
||||||
|
default-key "rndckey";
|
||||||
|
};
|
||||||
|
|
||||||
|
server localhost {
|
||||||
|
key "rndckey";
|
||||||
|
};
|
||||||
|
|
||||||
|
include "/etc/rndc.key";
|
420
bind.spec
Normal file
420
bind.spec
Normal file
@ -0,0 +1,420 @@
|
|||||||
|
%define groupid 65006
|
||||||
|
%define userid 65006
|
||||||
|
|
||||||
|
%define pkgver %(echo %version | sed 's|.P|-P|' | sed 's|.W|-W|')
|
||||||
|
%define majver %(echo %version | cut -d. -f 1-3)
|
||||||
|
%define MAJver %(echo %version | cut -d. -f 1-2)
|
||||||
|
|
||||||
|
Name: bind
|
||||||
|
Version: 9.9.5.W1
|
||||||
|
Release: 1mamba
|
||||||
|
Summary: A DNS (Domain Name System) server
|
||||||
|
Group: System/Servers
|
||||||
|
Vendor: openmamba
|
||||||
|
Distribution: openmamba
|
||||||
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
|
URL: http://www.isc.org/products/BIND/
|
||||||
|
Source0: ftp://ftp.isc.org/isc/bind9/%{pkgver}/bind-%{pkgver}.tar.gz
|
||||||
|
Source1: dhcp-dynamic-dns-examples.tar.bz2
|
||||||
|
Source2: named.init
|
||||||
|
Source3: named.logrotate
|
||||||
|
Source4: named.sysconfig
|
||||||
|
Source5: keygen.c
|
||||||
|
Source6: new_key.pl
|
||||||
|
Source8: update_bind.pl
|
||||||
|
Source10: bind-chroot.sh
|
||||||
|
Source11: ftp://ftp.rs.internic.net/domain/named.root
|
||||||
|
Source12: bind-named.conf
|
||||||
|
Source13: bind-localhost.zone
|
||||||
|
Source14: bind-named.local
|
||||||
|
Source15: bind-rndc.conf
|
||||||
|
Patch: %{name}-9.3.4-mktemp.patch
|
||||||
|
License: BSD
|
||||||
|
## AUTOBUILDREQ-BEGIN
|
||||||
|
BuildRequires: glibc-devel
|
||||||
|
BuildRequires: libcap-devel
|
||||||
|
BuildRequires: libopenssl-devel
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
|
BuildRequires: libz-devel
|
||||||
|
## AUTOBUILDREQ-END
|
||||||
|
BuildRequires: python-argparse
|
||||||
|
%if "%{stage1}" != "1"
|
||||||
|
BuildRequires: openjade
|
||||||
|
BuildRequires: jadetex
|
||||||
|
%endif
|
||||||
|
Requires: python-argparse
|
||||||
|
Requires: %{name}-utils = %{version}-%{release}
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
|
|
||||||
|
# FIXME :
|
||||||
|
# checking for catalog... "not found"
|
||||||
|
# checking for html/docbook.dsl... "not found"
|
||||||
|
# checking for print/docbook.dsl... "not found"
|
||||||
|
# checking for dtds/decls/xml.dcl... "not found"
|
||||||
|
# checking for docbook2X/docbook2man-spec.pl... "not found"
|
||||||
|
|
||||||
|
%description
|
||||||
|
BIND (Berkeley Internet Name Domain) is an implementation of the DNS (Domain Name System) protocols.
|
||||||
|
BIND includes a DNS server (named), which resolves host names to IP addresses; a resolver library (routines for applications to use when interfacing with DNS); and tools for verifying that the DNS server is operating properly.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Include files and libraries needed for bind DNS development.
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
The bind-devel package contains all the include files and the library required for DNS (Domain Name System) development for BIND versions 9.x.x.
|
||||||
|
|
||||||
|
%package utils
|
||||||
|
Summary: Utilities for querying DNS name servers.
|
||||||
|
Group: Applications/Networking
|
||||||
|
|
||||||
|
%description utils
|
||||||
|
Bind-utils contains a collection of utilities for querying DNS (Domain Name System) name servers to find out information about Internet hosts.
|
||||||
|
These tools will provide you with the IP addresses for given host names, as well as other information about registered domains and network addresses.
|
||||||
|
|
||||||
|
You should install bind-utils if you need to get information from DNS name servers.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}-%{pkgver}
|
||||||
|
%patch -p1 -b .mktemp
|
||||||
|
|
||||||
|
#pushd contrib/queryperf
|
||||||
|
#autoconf
|
||||||
|
#popd
|
||||||
|
|
||||||
|
tar xjf %{S:1}
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure \
|
||||||
|
--enable-threads \
|
||||||
|
--enable-ipv6 \
|
||||||
|
LIBS="-ltermcap" \
|
||||||
|
%if "%{_host}" != "%{_build}"
|
||||||
|
--enable-epoll \
|
||||||
|
--with-randomdev=/dev/random \
|
||||||
|
BUILD_CC=%{_build}-gcc
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%make -j1
|
||||||
|
|
||||||
|
%install
|
||||||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
|
mkdir -p %{buildroot}/etc/{rc.d/init.d,logrotate.d}
|
||||||
|
mkdir -p %{buildroot}/etc/sysconfig
|
||||||
|
mkdir -p %{buildroot}%{_var}/named
|
||||||
|
mkdir -p %{buildroot}%{_var}/run/named
|
||||||
|
mkdir -p %{buildroot}%{_var}/named/slave
|
||||||
|
|
||||||
|
%makeinstall
|
||||||
|
|
||||||
|
touch %{buildroot}%{_sysconfdir}/rndc.key
|
||||||
|
cp contrib/named-bootconf/named-bootconf.sh \
|
||||||
|
%{buildroot}%{_sbindir}/named-bootconf
|
||||||
|
cp contrib/nanny/nanny.pl %{buildroot}%{_sbindir}
|
||||||
|
#cp contrib/queryperf/queryperf %{buildroot}%{_sbindir}
|
||||||
|
cp contrib/queryperf/README ./README.queryperf
|
||||||
|
|
||||||
|
cp %{S:2} %{buildroot}%{_initrddir}/named
|
||||||
|
cp %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/named
|
||||||
|
cp %{S:4} %{buildroot}/etc/sysconfig/named
|
||||||
|
|
||||||
|
%{__cc} %{optflags} -o %{buildroot}%{_sbindir}/dns-keygen %{S:5}
|
||||||
|
|
||||||
|
cp %{S:6} %{buildroot}%{_sbindir}
|
||||||
|
cp %{S:8} %{buildroot}%{_sbindir}
|
||||||
|
cp %{S:10} %{buildroot}%{_sbindir}
|
||||||
|
|
||||||
|
install -m 644 %{S:11} %{buildroot}%{_var}/named/named.ca
|
||||||
|
|
||||||
|
cp %{S:12} %{buildroot}/etc/named.conf
|
||||||
|
cp %{S:13} %{buildroot}%{_var}/named/localhost.zone
|
||||||
|
cp %{S:14} %{buildroot}%{_var}/named/named.local
|
||||||
|
cp %{S:15} %{buildroot}%{_sysconfdir}/rndc.conf
|
||||||
|
|
||||||
|
%clean
|
||||||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
|
|
||||||
|
%pre
|
||||||
|
if [ $1 -eq 1 ]; then
|
||||||
|
# new install
|
||||||
|
groupadd named -g %{groupid} 2>/dev/null
|
||||||
|
useradd -u %{userid} -c 'nameserver daemon' -d /dev/null \
|
||||||
|
-g named -s /bin/false named
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%post
|
||||||
|
if [ $1 -eq 1 ]; then
|
||||||
|
# new install
|
||||||
|
rndckey=`dns-keygen`
|
||||||
|
cat > /etc/rndc.key << _EOF
|
||||||
|
key "rndckey" {
|
||||||
|
algorithm hmac-md5;
|
||||||
|
secret "$rndckey";
|
||||||
|
};
|
||||||
|
_EOF
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 -eq 0 ]; then
|
||||||
|
# erase
|
||||||
|
[ -f /var/run/named/named.pid ] && service named stop
|
||||||
|
chkconfig --del named
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%postun
|
||||||
|
if [ $1 -eq 1 ]; then
|
||||||
|
# update
|
||||||
|
[ -f /var/run/named/named.pid ] && service named restart
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_sysconfdir}/bind.keys
|
||||||
|
%config(noreplace) %{_sysconfdir}/sysconfig/named
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/named
|
||||||
|
%config(noreplace) %{_sysconfdir}/rndc.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/rndc.key
|
||||||
|
%config(noreplace) %{_sysconfdir}/named.conf
|
||||||
|
%attr(0755,root,root) %{_sbindir}/bind-chroot.sh
|
||||||
|
%{_sbindir}/dns-keygen
|
||||||
|
%{_sbindir}/ddns-confgen
|
||||||
|
%{_sbindir}/dnssec-checkds
|
||||||
|
%{_sbindir}/dnssec-coverage
|
||||||
|
%{_sbindir}/dnssec-dsfromkey
|
||||||
|
%{_sbindir}/dnssec-keyfromlabel
|
||||||
|
%{_sbindir}/dnssec-keygen
|
||||||
|
%{_sbindir}/dnssec-importkey
|
||||||
|
%{_sbindir}/dnssec-revoke
|
||||||
|
%{_sbindir}/dnssec-settime
|
||||||
|
%{_sbindir}/dnssec-signzone
|
||||||
|
%{_sbindir}/dnssec-verify
|
||||||
|
%{_sbindir}/lwresd
|
||||||
|
%{_sbindir}/named
|
||||||
|
%attr(0755,root,root) %{_sbindir}/named-bootconf
|
||||||
|
%{_sbindir}/named-checkconf
|
||||||
|
%{_sbindir}/named-checkzone
|
||||||
|
%{_sbindir}/named-compilezone
|
||||||
|
%{_sbindir}/named-journalprint
|
||||||
|
%attr(0755,root,root) %{_sbindir}/nanny.pl
|
||||||
|
%attr(0755,root,root) %{_sbindir}/new_key.pl
|
||||||
|
%{_sbindir}/rndc
|
||||||
|
%{_sbindir}/rndc-confgen
|
||||||
|
%attr(0755,root,root) %{_sbindir}/update_bind.pl
|
||||||
|
%attr(0755,root,root) %config(noreplace) %{_initrddir}/named
|
||||||
|
%dir %attr(0755,named,named) %{_localstatedir}/named
|
||||||
|
%dir %attr(0755,named,named) %{_localstatedir}/named/slave
|
||||||
|
%dir %attr(0755,named,named) %{_localstatedir}/run/named
|
||||||
|
%attr(0755,named,named) %{_var}/named/*
|
||||||
|
%{_mandir}/man3/*
|
||||||
|
%{_mandir}/man5/named.conf.*
|
||||||
|
%{_mandir}/man5/rndc.conf.*
|
||||||
|
%{_mandir}/man8/ddns-confgen.*
|
||||||
|
%{_mandir}/man8/dnssec-checkds.8*
|
||||||
|
%{_mandir}/man8/dnssec-coverage.8*
|
||||||
|
%{_mandir}/man8/dnssec-dsfromkey.*
|
||||||
|
%{_mandir}/man8/dnssec-keyfromlabel.*
|
||||||
|
%{_mandir}/man8/dnssec-signzone.*
|
||||||
|
%{_mandir}/man8/dnssec-keygen.*
|
||||||
|
%{_mandir}/man8/dnssec-revoke.*
|
||||||
|
%{_mandir}/man8/dnssec-settime.*
|
||||||
|
%{_mandir}/man8/dnssec-verify.8*
|
||||||
|
%{_mandir}/man8/lwresd.*
|
||||||
|
%{_mandir}/man8/named-checkconf.*
|
||||||
|
%{_mandir}/man8/named-checkzone.*
|
||||||
|
%{_mandir}/man8/named-compilezone.*
|
||||||
|
%{_mandir}/man8/named-journalprint.*
|
||||||
|
%{_mandir}/man8/named.*
|
||||||
|
%{_mandir}/man8/rndc-confgen.*
|
||||||
|
%{_mandir}/man8/rndc.*
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_bindir}/bind9-config
|
||||||
|
%{_includedir}/dns/
|
||||||
|
%{_includedir}/isc/
|
||||||
|
%{_includedir}/isccc/
|
||||||
|
%{_includedir}/isccfg/
|
||||||
|
%{_includedir}/lwres/
|
||||||
|
%{_includedir}/dst/
|
||||||
|
%{_includedir}/bind9/
|
||||||
|
%{_libdir}/*
|
||||||
|
|
||||||
|
%files utils
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_bindir}/dig
|
||||||
|
%{_bindir}/host
|
||||||
|
%{_bindir}/isc-config.sh
|
||||||
|
%{_bindir}/nslookup
|
||||||
|
%{_bindir}/nsupdate
|
||||||
|
%{_sbindir}/arpaname
|
||||||
|
%{_sbindir}/genrandom
|
||||||
|
%{_sbindir}/isc-hmac-fixup
|
||||||
|
%{_sbindir}/nsec3hash
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
%{_mandir}/man8/genrandom.*
|
||||||
|
%{_mandir}/man8/isc-hmac-fixup.*
|
||||||
|
%{_mandir}/man8/nsec3hash.*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sun Apr 13 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 9.9.5.W1-1mamba
|
||||||
|
- update to 9.9.5.W1
|
||||||
|
|
||||||
|
* Sat Feb 01 2014 Automatic Build System <autodist@mambasoft.it> 9.9.5-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Tue Jan 14 2014 Automatic Build System <autodist@mambasoft.it> 9.9.4.P2-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Thu Nov 07 2013 Automatic Build System <autodist@mambasoft.it> 9.9.4.P1-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Fri Sep 20 2013 Automatic Build System <autodist@mambasoft.it> 9.9.4-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Sat Jul 27 2013 Automatic Build System <autodist@mambasoft.it> 9.9.3.P2-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Wed Jun 05 2013 Automatic Build System <autodist@mambasoft.it> 9.9.3.P1-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Wed May 29 2013 Automatic Build System <autodist@mambasoft.it> 9.9.3-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Tue Mar 26 2013 Automatic Build System <autodist@mambasoft.it> 9.9.2.P2-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Tue Dec 04 2012 Automatic Build System <autodist@mambasoft.it> 9.9.2.P1-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Wed Oct 10 2012 Automatic Build System <autodist@mambasoft.it> 9.9.2-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Sun Aug 12 2012 Automatic Build System <autodist@mambasoft.it> 9.9.1.P2-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Mon Jun 04 2012 Automatic Build System <autodist@mambasoft.it> 9.9.1.P1-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Tue May 22 2012 Automatic Build System <autodist@mambasoft.it> 9.9.1-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Mon Apr 02 2012 Automatic Build System <autodist@mambasoft.it> 9.9.0-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
|
* Fri Dec 09 2011 Automatic Build System <autodist@mambasoft.it> 9.8.1.P1-1mamba
|
||||||
|
- update to 9.8.1.P1
|
||||||
|
|
||||||
|
* Thu Sep 01 2011 Automatic Build System <autodist@mambasoft.it> 9.8.1-1mamba
|
||||||
|
- update to 9.8.1
|
||||||
|
|
||||||
|
* Sun Jul 24 2011 Automatic Build System <autodist@mambasoft.it> 9.8.0.P4-1mamba
|
||||||
|
- update to 9.8.0.P4
|
||||||
|
|
||||||
|
* Fri Feb 18 2011 Automatic Build System <autodist@mambasoft.it> 9.7.3-1mamba
|
||||||
|
- update to 9.7.3
|
||||||
|
|
||||||
|
* Thu Dec 09 2010 Automatic Build System <autodist@mambasoft.it> 9.7.2.P3-1mamba
|
||||||
|
- automatic update by autodist
|
||||||
|
|
||||||
|
* Wed Nov 10 2010 Automatic Build System <autodist@mambasoft.it> 9.7.2.P2-1mamba
|
||||||
|
- automatic update by autodist
|
||||||
|
|
||||||
|
* Fri Sep 17 2010 Automatic Build System <autodist@mambasoft.it> 9.7.2.P1-1mamba
|
||||||
|
- automatic update to 9.7.2.P1 by autodist
|
||||||
|
|
||||||
|
* Mon Sep 13 2010 Automatic Build System <autodist@mambasoft.it> 9.7.2-1mamba
|
||||||
|
- automatic update to 9.7.2 by autodist
|
||||||
|
|
||||||
|
* Mon Aug 16 2010 Automatic Build System <autodist@mambasoft.it> 9.7.1.P2-1mamba
|
||||||
|
- automatic update by autodist
|
||||||
|
|
||||||
|
* Fri Jul 09 2010 Automatic Build System <autodist@mambasoft.it> 9.7.1.P1-1mamba
|
||||||
|
- automatic update to 9.7.1.P1 by autodist
|
||||||
|
|
||||||
|
* Sun Jun 20 2010 Automatic Build System <autodist@mambasoft.it> 9.7.1-1mamba
|
||||||
|
- automatic update to 9.7.1 by autodist
|
||||||
|
|
||||||
|
* Tue Mar 16 2010 Automatic Build System <autodist@mambasoft.it> 9.7.0.P1-1mamba
|
||||||
|
- automatic update to 9.7.0.P1 by autodist
|
||||||
|
|
||||||
|
* Mon Mar 15 2010 Automatic Build System <autodist@mambasoft.it> 9.7.0-1mamba
|
||||||
|
- automatic update to 9.7.0 by autodist
|
||||||
|
|
||||||
|
* Sun Nov 29 2009 Automatic Build System <autodist@mambasoft.it> 9.6.1.P2-1mamba
|
||||||
|
- automatic update by autodist
|
||||||
|
|
||||||
|
* Wed Jul 29 2009 Automatic Build System <autodist@mambasoft.it> 9.6.1.P1-1mamba
|
||||||
|
- automatic update to 9.6.1.P1 by autodist
|
||||||
|
|
||||||
|
* Sat Jun 13 2009 Automatic Build System <autodist@mambasoft.it> 9.6.1-1mamba
|
||||||
|
- automatic update to 9.6.1 by autodist
|
||||||
|
|
||||||
|
* Thu Jan 08 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 9.6.0.P1-1mamba
|
||||||
|
- automatic update to 9.6.0.P1 by autodist
|
||||||
|
|
||||||
|
* Sun Dec 28 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 9.6.0-1mamba
|
||||||
|
- update to 9.6.0
|
||||||
|
|
||||||
|
* Sat Aug 30 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 9.5.0.P2-1mamba
|
||||||
|
- update to 9.5.0.P2
|
||||||
|
|
||||||
|
* Tue Jun 03 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 9.5.0-1mamba
|
||||||
|
- update to 9.5.0
|
||||||
|
|
||||||
|
* Tue Jun 05 2007 Aleph0 <aleph0@openmamba.org> 9.3.4-1mamba
|
||||||
|
- update to 9.3.4
|
||||||
|
- fixes the security issues CVE-2007-0493 and CVE-2007-0494
|
||||||
|
- updated initscript and patch1
|
||||||
|
|
||||||
|
* Mon Sep 11 2006 Davide Madrisan <davide.madrisan@qilinux.it> 9.3.2-2qilnx
|
||||||
|
- security update: CVE-2006-4095, CVE-2006-4096 (bugzilla#172)
|
||||||
|
|
||||||
|
* Wed Apr 12 2006 Davide Madrisan <davide.madrisan@qilinux.it> 9.3.2-1qilnx
|
||||||
|
- update to version 9.3.2 by autospec
|
||||||
|
- parallel building disabled
|
||||||
|
|
||||||
|
* Tue Nov 08 2005 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 9.3.1-1qilnx
|
||||||
|
- update to version 9.3.1 by autospec
|
||||||
|
- also fixes CAN-2005-034 (QiLinux bug#67)
|
||||||
|
|
||||||
|
* Mon Nov 29 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 9.3.0-1qilnx
|
||||||
|
- new version build
|
||||||
|
- removed automatic service activation on startup
|
||||||
|
- added check on upgrade restart script
|
||||||
|
|
||||||
|
* Mon Aug 16 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 9.2.3-3qilnx
|
||||||
|
- lame-servers logging disabled by default in named.conf
|
||||||
|
|
||||||
|
* Thu Dec 04 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 9.2.3-2qilnx
|
||||||
|
- added /var/named/slave dir
|
||||||
|
|
||||||
|
* Thu Nov 06 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 9.2.3-1qilnx
|
||||||
|
- new version rebuild
|
||||||
|
|
||||||
|
* Thu Aug 07 2003 Silvan Calarco <silvan.calarco@qinet.it> 9.2.2-7qilnx
|
||||||
|
- added automatic generation and configuration of rndc key
|
||||||
|
- update %%post etc. scripts to new-style
|
||||||
|
|
||||||
|
* Fri Jun 06 2003 Silvan Calarco <silvan.calarco@qinet.it> 9.2.2-6qilnx
|
||||||
|
- fixed /var/named dir ownership
|
||||||
|
|
||||||
|
* Wed May 21 2003 Silvan Calarco <silvan.calarco@qinet.it> 9.2.2-5qilnx
|
||||||
|
- added bind-utils require
|
||||||
|
- moved user creation in pre script
|
||||||
|
|
||||||
|
* Tue May 20 2003 Silvan Calarco <silvan.calarco@qinet.it> 9.2.2-4qilnx
|
||||||
|
- modified initscript so that service is started ok when effectively available
|
||||||
|
|
||||||
|
* Mon May 19 2003 Silvan Calarco <silvan.calarco@qinet.it> 9.2.2-3qilnx
|
||||||
|
- fixed configuration errors
|
||||||
|
|
||||||
|
* Wed May 14 2003 Alessandro Ramazzina <alessandro.ramazzina@qinet.it> 9.2.2-2qilnx
|
||||||
|
- Added attributes to the initrd files
|
||||||
|
|
||||||
|
* Mon May 12 2003 Alessandro Ramazzina <alessandro.ramazzina@qinet.it> 9.2.2-1qilnx
|
||||||
|
- creation of bind package
|
19
keygen.c
Normal file
19
keygen.c
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
FILE *f=fopen("/dev/urandom", "r");
|
||||||
|
char key[61];
|
||||||
|
int i=0;
|
||||||
|
char tmp;
|
||||||
|
memset(key, 0, 61);
|
||||||
|
while(i<60) {
|
||||||
|
tmp=fgetc(f);
|
||||||
|
if((tmp>='a' && tmp<='z') ||
|
||||||
|
(tmp>='A' && tmp<='Z') ||
|
||||||
|
(tmp>='0' && tmp<='0'))
|
||||||
|
key[i++]=tmp;
|
||||||
|
}
|
||||||
|
puts(key);
|
||||||
|
fclose(f);
|
||||||
|
}
|
86
named.init
Normal file
86
named.init
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# named -- This shell script takes care of starting and stopping
|
||||||
|
# named (BIND DNS server).
|
||||||
|
#
|
||||||
|
# chkconfig: 345 30 45
|
||||||
|
# description: named (BIND) is a Domain Name Server (DNS) \
|
||||||
|
# that is used to resolve host names to IP addresses.
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
# Source networking configuration.
|
||||||
|
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
|
||||||
|
|
||||||
|
NAME=named
|
||||||
|
DAEMON=/usr/sbin/$NAME
|
||||||
|
DAEMONPID=/var/run/$NAME.pid
|
||||||
|
DAEMONCONF=/etc/named.conf
|
||||||
|
DAEMONLOG=
|
||||||
|
OPTIONS=
|
||||||
|
|
||||||
|
[ -x $DAEMON ] || exit 0
|
||||||
|
|
||||||
|
# Check that networking is up.
|
||||||
|
[ "${NETWORKING}" = "no" ] && exit 0
|
||||||
|
|
||||||
|
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
|
||||||
|
|
||||||
|
[ -r ${ROOTDIR}${DAEMONCONF} ] || exit 0
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
# See how we were called.
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n $"Starting $NAME: "
|
||||||
|
if [ -n "$ROOTDIR" -a "x$ROOTDIR" != "x/" ]; then
|
||||||
|
OPTIONS="$OPTIONS -t $ROOTDIR"
|
||||||
|
fi
|
||||||
|
daemon $DAEMON -u named $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
|
||||||
|
echo
|
||||||
|
# perform a query so we are sure service is working
|
||||||
|
# before the system starts other services
|
||||||
|
dig > /dev/null
|
||||||
|
exit $RETVAL
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n $"Stopping $NAME: "
|
||||||
|
killproc $DAEMON
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
|
||||||
|
exit $RETVAL
|
||||||
|
;;
|
||||||
|
restart|force-reload)
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
[ -e /var/lock/subsys/$NAME ] && $0 restart
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
/usr/sbin/rndc -c $ROOTDIR/etc/rndc.conf reload >/dev/null 2>&1 || \
|
||||||
|
/usr/bin/killall -HUP $NAME
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
/usr/sbin/rndc -c $ROOTDIR/etc/rndc.conf status
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
probe)
|
||||||
|
# named knows how to reload intelligently; we don't want linuxconf
|
||||||
|
# to offer to restart every time
|
||||||
|
/usr/sbin/rndc -c $ROOTDIR/etc/rndc.conf reload >/dev/null 2>&1 || \
|
||||||
|
echo start
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|restart|condrestart|reload|probe}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
6
named.logrotate
Normal file
6
named.logrotate
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/var/log/named.log {
|
||||||
|
missingok
|
||||||
|
postrotate
|
||||||
|
/bin/kill -HUP `cat /var/run/named.pid 2> /dev/null` 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
87
named.root
Normal file
87
named.root
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
; This file holds the information on root name servers needed to
|
||||||
|
; initialize cache of Internet domain name servers
|
||||||
|
; (e.g. reference this file in the "cache . <file>"
|
||||||
|
; configuration file of BIND domain name servers).
|
||||||
|
;
|
||||||
|
; This file is made available by InterNIC
|
||||||
|
; under anonymous FTP as
|
||||||
|
; file /domain/named.cache
|
||||||
|
; on server FTP.INTERNIC.NET
|
||||||
|
; -OR- RS.INTERNIC.NET
|
||||||
|
;
|
||||||
|
; last update: Jun 17, 2010
|
||||||
|
; related version of root zone: 2010061700
|
||||||
|
;
|
||||||
|
; formerly NS.INTERNIC.NET
|
||||||
|
;
|
||||||
|
. 3600000 IN NS A.ROOT-SERVERS.NET.
|
||||||
|
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
|
||||||
|
A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30
|
||||||
|
;
|
||||||
|
; FORMERLY NS1.ISI.EDU
|
||||||
|
;
|
||||||
|
. 3600000 NS B.ROOT-SERVERS.NET.
|
||||||
|
B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201
|
||||||
|
;
|
||||||
|
; FORMERLY C.PSI.NET
|
||||||
|
;
|
||||||
|
. 3600000 NS C.ROOT-SERVERS.NET.
|
||||||
|
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
|
||||||
|
;
|
||||||
|
; FORMERLY TERP.UMD.EDU
|
||||||
|
;
|
||||||
|
. 3600000 NS D.ROOT-SERVERS.NET.
|
||||||
|
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
|
||||||
|
;
|
||||||
|
; FORMERLY NS.NASA.GOV
|
||||||
|
;
|
||||||
|
. 3600000 NS E.ROOT-SERVERS.NET.
|
||||||
|
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
|
||||||
|
;
|
||||||
|
; FORMERLY NS.ISC.ORG
|
||||||
|
;
|
||||||
|
. 3600000 NS F.ROOT-SERVERS.NET.
|
||||||
|
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
|
||||||
|
F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F
|
||||||
|
;
|
||||||
|
; FORMERLY NS.NIC.DDN.MIL
|
||||||
|
;
|
||||||
|
. 3600000 NS G.ROOT-SERVERS.NET.
|
||||||
|
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
|
||||||
|
;
|
||||||
|
; FORMERLY AOS.ARL.ARMY.MIL
|
||||||
|
;
|
||||||
|
. 3600000 NS H.ROOT-SERVERS.NET.
|
||||||
|
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
|
||||||
|
H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235
|
||||||
|
;
|
||||||
|
; FORMERLY NIC.NORDU.NET
|
||||||
|
;
|
||||||
|
. 3600000 NS I.ROOT-SERVERS.NET.
|
||||||
|
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
|
||||||
|
I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53
|
||||||
|
;
|
||||||
|
; OPERATED BY VERISIGN, INC.
|
||||||
|
;
|
||||||
|
. 3600000 NS J.ROOT-SERVERS.NET.
|
||||||
|
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
|
||||||
|
J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30
|
||||||
|
;
|
||||||
|
; OPERATED BY RIPE NCC
|
||||||
|
;
|
||||||
|
. 3600000 NS K.ROOT-SERVERS.NET.
|
||||||
|
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
|
||||||
|
K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1
|
||||||
|
;
|
||||||
|
; OPERATED BY ICANN
|
||||||
|
;
|
||||||
|
. 3600000 NS L.ROOT-SERVERS.NET.
|
||||||
|
L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42
|
||||||
|
L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42
|
||||||
|
;
|
||||||
|
; OPERATED BY WIDE
|
||||||
|
;
|
||||||
|
. 3600000 NS M.ROOT-SERVERS.NET.
|
||||||
|
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
|
||||||
|
M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35
|
||||||
|
; End of File
|
6
named.sysconfig
Normal file
6
named.sysconfig
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Currently, you can use the following options:
|
||||||
|
# ROOTDIR="/some/where" -- will run named in a chroot environment.
|
||||||
|
# you must set up the chroot environment before
|
||||||
|
# doing this.
|
||||||
|
# OPTIONS="whatever" -- These additional options will be passed to named
|
||||||
|
# at startup. Don't add -t here, use ROOTDIR instead.
|
80
new_key.pl
Normal file
80
new_key.pl
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/bin/perl -W
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
# copyright (C) 2001 Florin Grad
|
||||||
|
#
|
||||||
|
# This is a really silly program that is supposed to generate a new key
|
||||||
|
# and update the existing one in /etc/rndc.conf or /etc/named.conf
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
my $key ="";
|
||||||
|
|
||||||
|
#generate the key
|
||||||
|
system ("dns-keygen > /etc/rndc.key") ;
|
||||||
|
open (KEY, "< /etc/rndc.key") or die "Can't open the/etc/rdnc.key_file file for reading";
|
||||||
|
while (<KEY>) {
|
||||||
|
chomp($_);
|
||||||
|
my @list = $_;
|
||||||
|
$key = $list[0];
|
||||||
|
}
|
||||||
|
close(KEY);
|
||||||
|
system ("rm -rf /etc/rndc.key");
|
||||||
|
|
||||||
|
#update the /etc/rndc.conf file
|
||||||
|
my $conf_file = "/etc/rndc.conf";
|
||||||
|
my $conf_file_backup = $conf_file.".backup";
|
||||||
|
|
||||||
|
open (CONF, "< $conf_file") or die "Can't open the $conf_file file for reading";
|
||||||
|
open (CONF_new, "> $conf_file_backup") or die "Can't open the $conf_file_backup file for writing";
|
||||||
|
while (<CONF>) {
|
||||||
|
chomp($_);
|
||||||
|
my @line = split (/\s+|\t+/,$_) ;
|
||||||
|
if ($line[1] && ($line[1] eq "secret") && $line[2] && ($line[2] ne "must")) {
|
||||||
|
print CONF_new "\tsecret \"".$key."\";\n";
|
||||||
|
next;
|
||||||
|
};
|
||||||
|
print CONF_new "$_\n";
|
||||||
|
};
|
||||||
|
close (CONF_new);
|
||||||
|
close (CONF);
|
||||||
|
rename ("$conf_file","$conf_file".".orig");
|
||||||
|
rename ("$conf_file_backup","$conf_file");
|
||||||
|
|
||||||
|
#update the /etc/.named file
|
||||||
|
$conf_file = "/etc/named.conf";
|
||||||
|
$conf_file_backup = $conf_file.".backup";
|
||||||
|
|
||||||
|
open (CONF, "< $conf_file") or die "Can't open the $conf_file file for reading";
|
||||||
|
open (CONF_new, "> $conf_file_backup") or die "Can't open the $conf_file_backup file for writing";
|
||||||
|
while (<CONF>) {
|
||||||
|
chomp($_);
|
||||||
|
my @line = split (/\s+|\t+/,$_) ;
|
||||||
|
if ($line[1] && ($line[1] eq "secret") && $line[2] && ($line[2] ne "must")) {
|
||||||
|
print CONF_new "\tsecret \"".$key."\";\n";
|
||||||
|
next;
|
||||||
|
};
|
||||||
|
print CONF_new "$_\n";
|
||||||
|
};
|
||||||
|
close (CONF_new);
|
||||||
|
close (CONF);
|
||||||
|
rename ("$conf_file","$conf_file".".orig");
|
||||||
|
rename ("$conf_file_backup","$conf_file");
|
||||||
|
|
||||||
|
#fix permissions
|
||||||
|
system "chmod 0600 /etc/rndc.conf /etc/named.conf";
|
||||||
|
system "chown named.named /etc/rndc.conf /etc/named.conf";
|
||||||
|
|
||||||
|
|
56
update_bind.pl
Normal file
56
update_bind.pl
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/perl -W
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
# copyright (C) 2001 Florin Grad
|
||||||
|
#
|
||||||
|
# This is a really silly program that is supposed to allow an update of
|
||||||
|
# a dhcp-2* server to a dhcp-3* server
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#search for a ddns-update-style entry in /etc/dhcpd.conf file
|
||||||
|
my $conf_file = "/etc/named.conf"; #$ARGV[0];
|
||||||
|
my $conf_file_orig = "/etc/named.conf.orig";
|
||||||
|
my $i=0;
|
||||||
|
open (NAMEDCONF, "< $conf_file") or die "Can't open the $conf_file file for reading";
|
||||||
|
while (<NAMEDCONF>) {
|
||||||
|
if (/pid-file/) {
|
||||||
|
$i++;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
close (NAMEDCONF);
|
||||||
|
|
||||||
|
if ($i == 0) { #we are on a bind8
|
||||||
|
my $pid_line = 0;
|
||||||
|
rename("$conf_file","$conf_file_orig") || die "Can't rename $conf_file: $!";
|
||||||
|
open (NAMEDCONF_ORIG, "< $conf_file_orig") or die "Can't open the $conf_file_orig file for reading";
|
||||||
|
open (NAMEDCONF, "> $conf_file") or die "Can't open the $conf_file file for writing";
|
||||||
|
while (<NAMEDCONF_ORIG>) {
|
||||||
|
if (/options/) {
|
||||||
|
$pid_line++;
|
||||||
|
print NAMEDCONF "$_"; # copy the current line in the new file
|
||||||
|
next;
|
||||||
|
};
|
||||||
|
if ($pid_line == 0) { # didn't reach the the options section yet
|
||||||
|
print NAMEDCONF "$_"; # copy the current line in the new file
|
||||||
|
} else {
|
||||||
|
print NAMEDCONF "\tpid-file \"/var/run/named/named.pid\"\;\n"; #add the missing line
|
||||||
|
$pid_line = 0;
|
||||||
|
print NAMEDCONF "$_";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
close (NAMEDCONF_ORIG);
|
||||||
|
close (NAMEDCONF);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user