diff options
Diffstat (limited to 'source/n/bind')
-rw-r--r-- | source/n/bind/3link.sh | 136 | ||||
-rwxr-xr-x | source/n/bind/bind.SlackBuild | 164 | ||||
-rw-r--r-- | source/n/bind/bind.man.diff | 22 | ||||
-rw-r--r-- | source/n/bind/bind.so_bsdcompat.diff | 11 | ||||
-rw-r--r-- | source/n/bind/bind.var.run.named.diff | 14 | ||||
-rw-r--r-- | source/n/bind/caching-example/localhost.zone | 11 | ||||
-rw-r--r-- | source/n/bind/caching-example/named.conf | 31 | ||||
-rw-r--r-- | source/n/bind/caching-example/named.local | 10 | ||||
-rw-r--r-- | source/n/bind/caching-example/named.root | 85 | ||||
-rw-r--r-- | source/n/bind/doinst.sh | 36 | ||||
-rw-r--r-- | source/n/bind/rc.bind | 112 | ||||
-rw-r--r-- | source/n/bind/slack-desc | 19 |
12 files changed, 651 insertions, 0 deletions
diff --git a/source/n/bind/3link.sh b/source/n/bind/3link.sh new file mode 100644 index 00000000..ec8ba4d1 --- /dev/null +++ b/source/n/bind/3link.sh @@ -0,0 +1,136 @@ +rm -f lwres_addr_parse.3 +ln -sf lwres_resutil.3 lwres_addr_parse.3 +rm -f lwres_buffer_add.3 +ln -sf lwres_buffer.3 lwres_buffer_add.3 +rm -f lwres_buffer_back.3 +ln -sf lwres_buffer.3 lwres_buffer_back.3 +rm -f lwres_buffer_clear.3 +ln -sf lwres_buffer.3 lwres_buffer_clear.3 +rm -f lwres_buffer_first.3 +ln -sf lwres_buffer.3 lwres_buffer_first.3 +rm -f lwres_buffer_forward.3 +ln -sf lwres_buffer.3 lwres_buffer_forward.3 +rm -f lwres_buffer_getmem.3 +ln -sf lwres_buffer.3 lwres_buffer_getmem.3 +rm -f lwres_buffer_getuint16.3 +ln -sf lwres_buffer.3 lwres_buffer_getuint16.3 +rm -f lwres_buffer_getuint32.3 +ln -sf lwres_buffer.3 lwres_buffer_getuint32.3 +rm -f lwres_buffer_getuint8.3 +ln -sf lwres_buffer.3 lwres_buffer_getuint8.3 +rm -f lwres_buffer_init.3 +ln -sf lwres_buffer.3 lwres_buffer_init.3 +rm -f lwres_buffer_invalidate.3 +ln -sf lwres_buffer.3 lwres_buffer_invalidate.3 +rm -f lwres_buffer_putmem.3 +ln -sf lwres_buffer.3 lwres_buffer_putmem.3 +rm -f lwres_buffer_putuint16.3 +ln -sf lwres_buffer.3 lwres_buffer_putuint16.3 +rm -f lwres_buffer_putuint32.3 +ln -sf lwres_buffer.3 lwres_buffer_putuint32.3 +rm -f lwres_buffer_putuint8.3 +ln -sf lwres_buffer.3 lwres_buffer_putuint8.3 +rm -f lwres_buffer_subtract.3 +ln -sf lwres_buffer.3 lwres_buffer_subtract.3 +rm -f lwres_conf_clear.3 +ln -sf lwres_config.3 lwres_conf_clear.3 +rm -f lwres_conf_get.3 +ln -sf lwres_config.3 lwres_conf_get.3 +rm -f lwres_conf_init.3 +ln -sf lwres_config.3 lwres_conf_init.3 +rm -f lwres_conf_parse.3 +ln -sf lwres_config.3 lwres_conf_parse.3 +rm -f lwres_conf_print.3 +ln -sf lwres_config.3 lwres_conf_print.3 +rm -f lwres_context_allocmem.3 +ln -sf lwres_context.3 lwres_context_allocmem.3 +rm -f lwres_context_create.3 +ln -sf lwres_context.3 lwres_context_create.3 +rm -f lwres_context_destroy.3 +ln -sf lwres_context.3 lwres_context_destroy.3 +rm -f lwres_context_freemem.3 +ln -sf lwres_context.3 lwres_context_freemem.3 +rm -f lwres_context_initserial.3 +ln -sf lwres_context.3 lwres_context_initserial.3 +rm -f lwres_context_nextserial.3 +ln -sf lwres_context.3 lwres_context_nextserial.3 +rm -f lwres_context_sendrecv.3 +ln -sf lwres_context.3 lwres_context_sendrecv.3 +rm -f lwres_endhostent.3 +ln -sf lwres_gethostent.3 lwres_endhostent.3 +rm -f lwres_endhostent_r.3 +ln -sf lwres_gethostent.3 lwres_endhostent_r.3 +rm -f lwres_freeaddrinfo.3 +ln -sf lwres_getaddrinfo.3 lwres_freeaddrinfo.3 +rm -f lwres_freehostent.3 +ln -sf lwres_getipnode.3 lwres_freehostent.3 +rm -f lwres_gabnrequest_free.3 +ln -sf lwres_gabn.3 lwres_gabnrequest_free.3 +rm -f lwres_gabnrequest_parse.3 +ln -sf lwres_gabn.3 lwres_gabnrequest_parse.3 +rm -f lwres_gabnrequest_render.3 +ln -sf lwres_gabn.3 lwres_gabnrequest_render.3 +rm -f lwres_gabnresponse_free.3 +ln -sf lwres_gabn.3 lwres_gabnresponse_free.3 +rm -f lwres_gabnresponse_parse.3 +ln -sf lwres_gabn.3 lwres_gabnresponse_parse.3 +rm -f lwres_gabnresponse_render.3 +ln -sf lwres_gabn.3 lwres_gabnresponse_render.3 +rm -f lwres_getaddrsbyname.3 +ln -sf lwres_resutil.3 lwres_getaddrsbyname.3 +rm -f lwres_gethostbyaddr.3 +ln -sf lwres_gethostent.3 lwres_gethostbyaddr.3 +rm -f lwres_gethostbyaddr_r.3 +ln -sf lwres_gethostent.3 lwres_gethostbyaddr_r.3 +rm -f lwres_gethostbyname.3 +ln -sf lwres_gethostent.3 lwres_gethostbyname.3 +rm -f lwres_gethostbyname2.3 +ln -sf lwres_gethostent.3 lwres_gethostbyname2.3 +rm -f lwres_gethostbyname_r.3 +ln -sf lwres_gethostent.3 lwres_gethostbyname_r.3 +rm -f lwres_gethostent_r.3 +ln -sf lwres_gethostent.3 lwres_gethostent_r.3 +rm -f lwres_getipnodebyaddr.3 +ln -sf lwres_getipnode.3 lwres_getipnodebyaddr.3 +rm -f lwres_getipnodebyname.3 +ln -sf lwres_getipnode.3 lwres_getipnodebyname.3 +rm -f lwres_getnamebyaddr.3 +ln -sf lwres_resutil.3 lwres_getnamebyaddr.3 +rm -f lwres_gnbarequest_free.3 +ln -sf lwres_gnba.3 lwres_gnbarequest_free.3 +rm -f lwres_gnbarequest_parse.3 +ln -sf lwres_gnba.3 lwres_gnbarequest_parse.3 +rm -f lwres_gnbarequest_render.3 +ln -sf lwres_gnba.3 lwres_gnbarequest_render.3 +rm -f lwres_gnbaresponse_free.3 +ln -sf lwres_gnba.3 lwres_gnbaresponse_free.3 +rm -f lwres_gnbaresponse_parse.3 +ln -sf lwres_gnba.3 lwres_gnbaresponse_parse.3 +rm -f lwres_gnbaresponse_render.3 +ln -sf lwres_gnba.3 lwres_gnbaresponse_render.3 +rm -f lwres_herror.3 +ln -sf lwres_hstrerror.3 lwres_herror.3 +rm -f lwres_lwpacket_parseheader.3 +ln -sf lwres_packet.3 lwres_lwpacket_parseheader.3 +rm -f lwres_lwpacket_renderheader.3 +ln -sf lwres_packet.3 lwres_lwpacket_renderheader.3 +rm -f lwres_net_ntop.3 +ln -sf lwres_inetntop.3 lwres_net_ntop.3 +rm -f lwres_nooprequest_free.3 +ln -sf lwres_noop.3 lwres_nooprequest_free.3 +rm -f lwres_nooprequest_parse.3 +ln -sf lwres_noop.3 lwres_nooprequest_parse.3 +rm -f lwres_nooprequest_render.3 +ln -sf lwres_noop.3 lwres_nooprequest_render.3 +rm -f lwres_noopresponse_free.3 +ln -sf lwres_noop.3 lwres_noopresponse_free.3 +rm -f lwres_noopresponse_parse.3 +ln -sf lwres_noop.3 lwres_noopresponse_parse.3 +rm -f lwres_noopresponse_render.3 +ln -sf lwres_noop.3 lwres_noopresponse_render.3 +rm -f lwres_sethostent.3 +ln -sf lwres_gethostent.3 lwres_sethostent.3 +rm -f lwres_sethostent_r.3 +ln -sf lwres_gethostent.3 lwres_sethostent_r.3 +rm -f lwres_string_parse.3 +ln -sf lwres_resutil.3 lwres_string_parse.3 diff --git a/source/n/bind/bind.SlackBuild b/source/n/bind/bind.SlackBuild new file mode 100755 index 00000000..afcde9e1 --- /dev/null +++ b/source/n/bind/bind.SlackBuild @@ -0,0 +1,164 @@ +#!/bin/sh + +# Copyright 2006, 2007, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PKGNAM=bind +VERSION=${VERSION:-9.4.3-P3} +ARCH=${ARCH:-x86_64} +NUMJOBS=${NUMJOBS:-" -j7 "} +BUILD=${BUILD:-1} + + +CWD=$(pwd) +TMP=/bind-$(mcookie) +PKG=$TMP/package-${PKGNAM} +rm -rf $PKG +mkdir -p $TMP $PKG + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +cd $TMP +rm -rf ${PKGNAM}-${VERSION} +tar xvf $CWD/${PKGNAM}-$VERSION.tar.gz || exit 1 +cd ${PKGNAM}-$VERSION || exit 1 + +# Remove use of SO_BSDCOMPAT which has been obsolete since the 2.2.x kernel series, +# and generates warnings under 2.6.x kernels: +zcat $CWD/bind.so_bsdcompat.diff.gz | patch -p1 --verbose || exit + +# We want to use /var/run/named/, not just /var/run/. +# This allows changing the ownership of that directory if we want to run +# named as a non-root user. +zcat $CWD/bind.var.run.named.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 +# Threads break '-u' on Linux (for now) + +# The man pages should reflect /var/run/named: +zcat $CWD/bind.man.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 + +# Make sure ownerships and permissions are sane: +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Configure: +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-libtool \ + --mandir=/usr/man \ + --enable-shared \ + --disable-static \ + --enable-threads \ + --with-openssl=/usr \ + --build=$ARCH-slackware-linux || exit 1 + +# Build and install: +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +# We like symlinks. +( cd $PKG/usr/sbin + ln -sf named lwresd +) + +# We like a lot of symlinks. +( cd $PKG/usr/man/man3 + sh $CWD/3link.sh +) + +# Install init script: +mkdir -p $PKG/etc/rc.d +cp -a $CWD/rc.bind $PKG/etc/rc.d/rc.bind.new +chmod 644 $PKG/etc/rc.d/rc.bind.new + +# Add /var/run/named directory: +mkdir -p $PKG/var/run/named + +# Fix library perms: +chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/* + +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Compress and link manpages, if any: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.* 2> /dev/null + ) + done + ) +fi + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +cp -a \ + CHANGES COPYRIGHT FAQ* README* \ + doc/arm doc/misc \ + $PKG/usr/doc/${PKGNAM}-$VERSION + +# This one should have the correct perms of the config file: +chmod 644 $PKG/usr/doc/${PKGNAM}-$VERSION/misc/rndc.conf-sample + +# One format of this is plenty. Especially get rid of the bloated PDF. +( cd $PKG/usr/doc/bind-$VERSION/arm + rm -f Makefile* *.pdf *.xml README.SGML latex-fixup.pl +) + +# Add sample config files for a simple caching nameserver: +mkdir -p $PKG/var/named/caching-example +cat $CWD/caching-example/named.conf > $PKG/etc/named.conf.new +cat $CWD/caching-example/localhost.zone > $PKG/var/named/caching-example/localhost.zone +cat $CWD/caching-example/named.local > $PKG/var/named/caching-example/named.local +cat $CWD/caching-example/named.root > $PKG/var/named/caching-example/named.root +# This name is deprecated, but having it here doesn't hurt in case +# an old configuration file wants it: +cat $CWD/caching-example/named.root > $PKG/var/named/caching-example/named.ca + +mkdir -p $PKG/install +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$(echo $VERSION | tr - _)-$ARCH-$BUILD.txz + diff --git a/source/n/bind/bind.man.diff b/source/n/bind/bind.man.diff new file mode 100644 index 00000000..6bcf1921 --- /dev/null +++ b/source/n/bind/bind.man.diff @@ -0,0 +1,22 @@ +--- ./bin/named/named.8.orig 2007-01-29 18:23:44.000000000 -0600 ++++ ./bin/named/named.8 2007-06-07 23:17:33.000000000 -0500 +@@ -202,7 +202,7 @@ + The default configuration file. + .RE + .PP +-\fI/var/run/named.pid\fR ++\fI/var/run/named/named.pid\fR + .RS 4 + The default process\-id file. + .RE +--- ./bin/named/lwresd.8.orig 2007-01-29 18:23:44.000000000 -0600 ++++ ./bin/named/lwresd.8 2007-06-07 23:17:18.000000000 -0500 +@@ -155,7 +155,7 @@ + The default configuration file. + .RE + .PP +-\fI/var/run/lwresd.pid\fR ++\fI/var/run/named/lwresd.pid\fR + .RS 4 + The default process\-id file. + .RE diff --git a/source/n/bind/bind.so_bsdcompat.diff b/source/n/bind/bind.so_bsdcompat.diff new file mode 100644 index 00000000..5d78031b --- /dev/null +++ b/source/n/bind/bind.so_bsdcompat.diff @@ -0,0 +1,11 @@ +--- ./lib/isc/unix/socket.c.orig 2005-11-03 17:08:42.000000000 -0600 ++++ ./lib/isc/unix/socket.c 2006-02-18 13:09:15.000000000 -0600 +@@ -245,6 +245,8 @@ + + #define SOCK_DEAD(s) ((s)->references == 0) + ++#undef SO_BSDCOMPAT ++ + static void + manager_log(isc_socketmgr_t *sockmgr, + isc_logcategory_t *category, isc_logmodule_t *module, int level, diff --git a/source/n/bind/bind.var.run.named.diff b/source/n/bind/bind.var.run.named.diff new file mode 100644 index 00000000..53cc8bd6 --- /dev/null +++ b/source/n/bind/bind.var.run.named.diff @@ -0,0 +1,14 @@ +--- ./bin/named/include/named/globals.h.orig Sat Nov 24 17:47:59 2001 ++++ ./bin/named/include/named/globals.h Tue Feb 26 18:51:18 2002 +@@ -102,9 +102,9 @@ + EXTERN isc_boolean_t ns_g_logstderr INIT(ISC_FALSE); + + EXTERN const char * ns_g_defaultpidfile INIT(NS_LOCALSTATEDIR +- "/run/named.pid"); ++ "/run/named/named.pid"); + EXTERN const char * lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR +- "/run/lwresd.pid"); ++ "/run/named/lwresd.pid"); + EXTERN const char * ns_g_username INIT(NULL); + + #undef EXTERN diff --git a/source/n/bind/caching-example/localhost.zone b/source/n/bind/caching-example/localhost.zone new file mode 100644 index 00000000..c47baf5f --- /dev/null +++ b/source/n/bind/caching-example/localhost.zone @@ -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 diff --git a/source/n/bind/caching-example/named.conf b/source/n/bind/caching-example/named.conf new file mode 100644 index 00000000..a8ee2795 --- /dev/null +++ b/source/n/bind/caching-example/named.conf @@ -0,0 +1,31 @@ +options { + directory "/var/named"; + /* + * 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 +// +zone "." IN { + type hint; + file "caching-example/named.root"; +}; + +zone "localhost" IN { + type master; + file "caching-example/localhost.zone"; + allow-update { none; }; +}; + +zone "0.0.127.in-addr.arpa" IN { + type master; + file "caching-example/named.local"; + allow-update { none; }; +}; diff --git a/source/n/bind/caching-example/named.local b/source/n/bind/caching-example/named.local new file mode 100644 index 00000000..8bfc435f --- /dev/null +++ b/source/n/bind/caching-example/named.local @@ -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. diff --git a/source/n/bind/caching-example/named.root b/source/n/bind/caching-example/named.root new file mode 100644 index 00000000..902a7047 --- /dev/null +++ b/source/n/bind/caching-example/named.root @@ -0,0 +1,85 @@ +; 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.root +; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET +; +; last update: Feb 04, 2008 +; related version of root zone: 2008020400 +; +; 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 +; +; 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 +; +; 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 diff --git a/source/n/bind/doinst.sh b/source/n/bind/doinst.sh new file mode 100644 index 00000000..afeff946 --- /dev/null +++ b/source/n/bind/doinst.sh @@ -0,0 +1,36 @@ +#!/bin/sh +config() { + NEW="$1" + OLD="`dirname $NEW`/`basename $NEW .new`" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.bind.new: +if [ -e etc/rc.d/rc.bind ]; then + cp -a etc/rc.d/rc.bind etc/rc.d/rc.bind.new.incoming + cat etc/rc.d/rc.bind.new > etc/rc.d/rc.bind.new.incoming + mv etc/rc.d/rc.bind.new.incoming etc/rc.d/rc.bind.new +fi + +config etc/named.conf.new +config etc/rc.d/rc.bind.new + +# Add a /var/named if it doesn't exist: +if [ ! -d var/named ]; then + mkdir -p var/named + chmod 755 var/named +fi + +# Generate /etc/rndc.key if there's none there, +# and there also no /etc/rndc.conf (the other +# way to set this up). +if [ ! -r etc/rndc.key -a ! -r /etc/rndc.conf ]; then + chroot . /sbin/ldconfig + chroot . /usr/sbin/rndc-confgen -r /dev/urandom -a 2> /dev/null +fi diff --git a/source/n/bind/rc.bind b/source/n/bind/rc.bind new file mode 100644 index 00000000..966670e3 --- /dev/null +++ b/source/n/bind/rc.bind @@ -0,0 +1,112 @@ +#!/bin/sh +# Start/stop/restart the BIND name server daemon (named). + +# Start bind. In the past it was more secure to run BIND +# as a non-root user (for example, with '-u daemon'), but +# the modern version of BIND knows how to use the kernel's +# capability mechanism to drop all root privileges except +# the ability to bind() to a privileged port and set process +# resource limits, so -u should not be needed. If you wish +# to use it anyway, chown the /var/run/named directory to +# the non-root user. +# + +# You might also consider running BIND in a "chroot jail", +# a discussion of which may be found in +# /usr/doc/Linux-HOWTOs/Chroot-BIND-HOWTO. + +# One last note: rndc has a lot of other nice features that +# it is not within the scope of this start/stop/restart script +# to support. For more details, see "man rndc" or just type +# "rndc" to see the options. + + +# Sanity check. If either /usr/sbin/named or /etc/named.conf +# aren't ready, it doesn't make much sense to try to run this +# script: +if [ ! -x /usr/sbin/named ]; then + echo "/etc/rc.d/rc.bind: no /usr/sbin/named found (or not executable); cannot start." + exit 1 +elif [ ! -f /etc/named.conf ]; then + echo "/etc/rc.d/rc.bind: no /etc/named.conf found; cannot start /usr/sbin/named." + exit 1 +fi + +# Start BIND. As many times as you like. ;-) +# Seriously, don't run "rc.bind start" if BIND is already +# running or you'll get more than one copy running. +bind_start() { + if [ -x /usr/sbin/named ]; then + echo "Starting BIND: /usr/sbin/named" + /usr/sbin/named + sleep 1 + fi + if ! ps axc | grep -q named ; then + echo "WARNING: named did not start." + echo "Attempting to start named again: /usr/sbin/named" + /usr/sbin/named + sleep 1 + if ps axc | grep -q named ; then + echo "SUCCESS: named started." + else + echo "FAILED: Sorry, a second attempt to start named has also failed." + echo "There may be a configuration error that needs fixing. Good luck!" + fi + fi +} + +# Stop all running copies of BIND (/usr/sbin/named): +bind_stop() { + echo "Stopping BIND: /usr/sbin/rndc stop" + /usr/sbin/rndc stop + # A problem with using "/usr/sbin/rndc stop" is that if you + # managed to get multiple copies of named running it will + # only stop one of them and then can't stop the others even + # if you run it again. So, after doing things the nice way + # we'll do them the old-fashioned way. If you don't like + # it you can comment it out, but unless you have a lot of + # other programs you run called "named" this is unlikely + # to have any ill effects: + sleep 1 + if ps axc | grep -q named ; then + echo "Using "killall named" on additional BIND processes..." + /bin/killall named 2> /dev/null + fi +} + +# Reload BIND: +bind_reload() { + /usr/sbin/rndc reload +} + +# Restart BIND: +bind_restart() { + bind_stop + bind_start +} + +# Get BIND status: +bind_status() { + /usr/sbin/rndc status +} + +case "$1" in +'start') + bind_start + ;; +'stop') + bind_stop + ;; +'reload') + bind_reload + ;; +'restart') + bind_restart + ;; +'status') + bind_status + ;; +*) + echo "usage $0 start|stop|reload|restart|status" +esac + diff --git a/source/n/bind/slack-desc b/source/n/bind/slack-desc new file mode 100644 index 00000000..9e9b15d1 --- /dev/null +++ b/source/n/bind/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +bind: bind (DNS server and utilities) +bind: +bind: The named daemon and support utilities such as dig, host, and +bind: nslookup. Sample configuration files for running a simple caching +bind: nameserver are included. Documentation for advanced name server +bind: setup can be found in /usr/doc/bind-9.x.x/. +bind: +bind: +bind: +bind: +bind: |