First check in

This commit is contained in:
2018-10-29 20:24:48 -05:00
commit de0a876a9d
15 changed files with 498 additions and 0 deletions

1
CONFIG/etc/default/named Normal file
View File

@@ -0,0 +1 @@
NAMEDOPTS="-u named -c /etc/named.conf"

50
CONFIG/etc/named.conf Normal file
View File

@@ -0,0 +1,50 @@
options {
directory "/var/named";
pid-file "/var/run/named.pid";
statistics-file "/var/run/named.stats";
};
zone "." {
type hint;
file "db.root";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "db.127";
};
// Bind 9 now logs by default through syslog (except debug).
// These are the default logging rules.
logging {
category default { default_syslog; default_debug; };
category unmatched { null; };
channel default_syslog {
syslog daemon; // send to syslog's daemon
// facility
severity info; // only send priority info
// and higher
};
channel default_debug {
file "named.run"; // write to named.run in
// the working directory
// Note: stderr is used instead
// of "named.run"
// if the server is started
// with the '-f' option.
severity dynamic; // log at the server's
// current debug level
};
channel default_stderr {
stderr; // writes to stderr
severity info; // only send priority info
// and higher
};
channel null {
null; // toss anything sent to
// this channel
};
};

13
CONFIG/var/named/db.127 Normal file
View File

@@ -0,0 +1,13 @@
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
1.0.0 IN PTR localhost.

92
CONFIG/var/named/db.root Normal file
View File

@@ -0,0 +1,92 @@
; 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: October 24, 2018
; related version of root zone: 2018102401
;
; FORMERLY NS.INTERNIC.NET
;
. 3600000 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 199.9.14.201
B.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:200::b
;
; FORMERLY C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
C.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2::c
;
; FORMERLY TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 199.7.91.13
D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2d::d
;
; FORMERLY NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
E.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:a8::e
;
; 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
G.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:12::d0d
;
; FORMERLY AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 198.97.190.53
H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::53
;
; 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:9f::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

178
Makefile Normal file
View File

@@ -0,0 +1,178 @@
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation here:
# (http://www.gnu.org/licenses/gpl-2.0.html)
#
# 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.
# Some, but not all of variables are required. The following list
# describes the required variables:
#
# * URL: The main website of the upstream project
# * REPO: The location of the package on the source pacakge
# server. This might be one of core, main, dev, or
# perhaps others.
# * BRIEF: Short description, should be 50 chars or less
# * SNAPVER: This is the package version. When a package is
# changed, but no changes are made to the source code
# this value should be increased. This would include
# things like usher being modified, changes to default
# configuration files, file permissions, etc.
# * ARCHIVE: The default commands that set this variable should
# work in most cases, but in some cases it may need
# to be modified. This variable should contain the
# path to the source of the package (./SRC/filename)
# * TYPE: This is probably not really needed due to the
# ability of gnu tar to figure it out on its own.
# Should probably be removed at some point.
# * SRCDIR: This is the name of the source directory after the
# package source is extracted. The default command
# should in most cases set this automatically.
# * PATCHDIR: This directory should be ./SRC/patches and is
# required, whether or not patches are used.
# * VERSION: This should be set automatically based on the
# version string in the source directory and SNAPVER.
# The default command here should work in many cases,
# but certain packages may need to use a different
# method.
#
# Variables that aren't required:
#
# * ARCH: This should be populated for packages which contain
# compiled binaries. If it is not populated the ARCH
# will be set to 'noarch'.
# * DEPENDS: If any other packages are required for this package
# to function then they need to be listed here,
# preferably in alphabetical order.
# * BUILDDEPS: Any package beyond packages from the core repo
# need to be listed here. The idea is that we
# can automate building and testing packages
# from clean core systems. The core repo is
# intended to include only the base minimum
# packages which provide a functional system.
# * SRCPKG: By default this is populated automatically with
# the name of the package (current directory). If
# the source package is used to generate multiple
# packages then this variable should contain the
# name of the git repo that tracks the source.
# * DESC: This is to be used to provide a longer description
# of the package.
export ARCH = x86_64
export DEPENDS = dash,e2fsprogs,glibc,krb5,libcap,libxml2,ncurses,openssl,readline,zlib
export BUILDDEPS =
export SRCPKG = $(PACKAGE)
export URL = https://www.isc.org/downloads/bind/
REPO = server
BRIEF = DNS server
DESC = BIND is open source software that enables you to publish your \
Domain Name System (DNS) information on the Internet, and to resolve \
DNS queries for your users.
SNAPVER = 0
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
PATCHDIR := $(PWD)/SRC/patches
export VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'| \
sed 's/^-//')-$(SNAPVER)
include /usr/share/snap/Makefile.snaplinux
DEV := $(PWD)/$(PACKAGE)-dev
DEVROOT := $(DEV)/ROOT
UTILS := $(PWD)/$(PACKAGE)-utils
UTILSROOT := $(UTILS)/ROOT
DOC := $(PWD)/$(PACKAGE)-doc
DOCROOT := $(DOC)/ROOT
$(SRCDIR)/configure: $(ARCHIVE)
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
tar -jxf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-gzip' ]; then \
tar -zxf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-tar' ]; then \
tar -xf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-xz' ]; then \
tar -xf $(ARCHIVE); \
else \
echo 'Unable to determine archive type'; \
exit 1; \
fi
@touch $(SRCDIR)/configure
$(SRCDIR)/config.log: $(SRCDIR)/configure
@cd $(SRCDIR) && \
for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
patch --verbose -Np1 -i $$patch; \
done
@cd $(SRCDIR); \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--enable-threads \
--with-libtool \
--build=x86_64-snap-linux-gnu \
--host=x86_64-snap-linux-gnu \
--target=x86_64-snap-linux-gnu
# binfile should be replaced with a file generated by the
# make process. It won't really break anything if not
# set to a valid file, but the source make process will
# be re-executed even if it isn't necessary
$(SRCDIR)/bin/named/.libs/named: $(SRCDIR)/config.log
@cd $(SRCDIR) && make
$(ROOT): $(SRCDIR)/bin/named/.libs/named
@if [ -d $(ROOT) ]; then \
touch $(ROOT); \
else \
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
install -v -m 0755 -d $(ROOT)/etc/init.d && \
install -v -m 0700 -d $(ROOT)/var/named && \
install -v -m 0755 $(SNAPDIR)/named.init $(ROOT)/etc/init.d/named && \
mv -v $(ROOT)/etc/bind.keys $(ROOT)/var/named/bind.keys
@install -v -d $(DEV)/SNAP $(DEVROOT) && \
for file in `find $(ROOT)| \
egrep 'man3\/|\.a$$|\.h$$|\.la$$'`; do \
path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \
mkdir -p $$path; \
mv $$file $$path; \
done && \
find $(ROOT) -type d -empty -delete && \
cd $(DEV) && make -f ../Makefile.dev && mv *.snap ../
@install -v -d $(UTILS)/SNAP $(UTILSROOT) && \
install -v -m 0755 -d $(UTILSROOT)/usr/bin && \
install -v -m 0755 -d $(UTILSROOT)/usr/share/man/man1 && \
mv -v $(ROOT)/usr/bin/{{,m}dig,host,nslookup} $(UTILSROOT)/usr/bin && \
mv -v $(ROOT)/usr/share/man/man1/{{,m}dig,host,nslookup}.1 \
$(UTILSROOT)/usr/share/man/man1 && \
cd $(UTILS) && make -f ../Makefile.utils && mv *.snap ../
@install -v -d $(DOC)/SNAP $(DOCROOT) && \
install -v -m 0755 -d $(DOCROOT)/usr/share/doc/bind && \
cp -a $(SRCDIR)/doc/* $(DOCROOT)/usr/share/doc/bind && \
cd $(DOC) && make -f ../Makefile.doc && mv *.snap ../
test: $(ROOT)
@cd $(SRCDIR); \
make check
clean:
@rm -rvf $(ROOT) \
$(DEV) \
$(DOC) \
$(UTILS) \
$(SNAPINFO) \
$(MANIFEST) \
$(FILES) \
$(SRCDIR)

16
Makefile.dev Normal file
View File

@@ -0,0 +1,16 @@
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation here:
# (http://www.gnu.org/licenses/gpl-2.0.html)
#
# 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.
DEPENDS = bind
REPO = dev
BRIEF = Development files for bind
DESC = Development files for bind
include /usr/share/snap/Makefile.snaplinux

16
Makefile.doc Normal file
View File

@@ -0,0 +1,16 @@
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation here:
# (http://www.gnu.org/licenses/gpl-2.0.html)
#
# 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.
REPO = main
DEPENDS =
BRIEF = Documentation for BIND DNS server and utilities
DESC = Documentation for BIND DNS server and utilities
include /usr/share/snap/Makefile.snaplinux

16
Makefile.utils Normal file
View File

@@ -0,0 +1,16 @@
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation here:
# (http://www.gnu.org/licenses/gpl-2.0.html)
#
# 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.
REPO = main
DEPENDS =
BRIEF = Bind DNS utilities
DESC = Bind DNS utilities
include /usr/share/snap/Makefile.snaplinux

5
SNAP/README Normal file
View File

@@ -0,0 +1,5 @@
This is the directory where the manifest, snapinfo,
and files.tar.gz files will be created. It is also
where the usher file should be placed if it is
required by the package. Any other files that need
to be included could also be placed here.

BIN
SNAP/config.tar.gz Normal file

Binary file not shown.

48
SNAP/named.init Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: bind
# Required-Start: $time $network
# Should-Start:
# Required-Stop: $network
# Should-Stop: $remote_fs
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: DNS Daemon
# Description: Provides a local DNS daemon
### END INIT INFO
. /lib/lsb/init-functions
[ -r /etc/default/named ] && . /etc/default/named
NAME="named"
DAEMON="/usr/sbin/named"
PIDFILE="/var/run/named.pid"
case "$1" in
start)
log_init_msg "Starting named"
start_daemon "$DAEMON" "$NAMEDOPTS" && log_success_msg || log_failure_msg
;;
stop)
log_init_msg "Stopping named"
killproc -p "$PIDFILE" "$DAEMON" && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
reload)
log_init_msg "Reloading named"
killproc -p "$PIDFILE" "$DAEMON" -HUP && log_success_msg || log_failure_msg
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON"
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
;;
esac

43
SNAP/usher Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/sh
set -e
case $1 in
preinst)
exit 0
;;
postinst)
if ! getent group named 2>&1 > /dev/null; then
if groupadd -g 20 named; then
echo 'Created group named'
else
echo 'Failed to create group named!'
exit 1
fi
fi
if ! getent passwd named 2>&1 > /dev/null; then
if useradd -c 'BIND Account' -g named \
-s /bin/false -u 20 named; then
echo 'Created user named'
else
echo 'Failed to create user named!'
exit 1
fi
fi
if [ -d /var/named ]; then
chown -R named:named /var/named
fi
/etc/init.d/named status 2>&1 > /dev/null && /etc/init.d/named restart
exit 0
;;
prerm)
/etc/init.d/named status 2>&1 > /dev/null && /etc/init.d/named stop
exit 0
;;
postrm)
exit 0
;;
esac

BIN
SRC/bind-9.13.3.tar.gz Normal file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iQIzBAABAgAdFiEEvg6XSLcYJToou4n/8bEb8FzwLlcFAluZfCwACgkQ8bEb8Fzw
Llf3lxAAqXleKpURG0rpVCm7M8jgl3/S3xV2SRssSRey7cy7GxY1UXtXGWilnRH9
lYHiQJ/JZDdCNmCMmSqUbHioRR3ujgZ4KB9qgo63EX4OciaFacT4oizzji1xQs91
WLwi9dkYYibTHwD+TzdTeALXy3VWWzgjlOFa7dVlhc+O5DH5VZGXlOv/rJvtBoEJ
XrRo4OLfGW8dYs7M4T7F3NINnsb5D5HjValVdkPvofT/ttcitMTcRi0aliLGAkWb
1374IdYEPA4iz0UA4pCgys2Uzl3BQ1KkMQUx7CMg2Ys3/fAmrU510dqXHreY1MlJ
hDZlZUuGbC2krik3eB21Ypni9G9x9vXg9hLSG/UQuXZWydTmm9bbf4A1iIQZQ9mv
MOYmyZsqnHTD+Y/bb2XyWQoTZLvVkNpNcfa3jM8C2fxFn3NfOERht1Ilz/pg0DIn
YRH0dzpplhKoeFZEvrYMxlBIJ6D1F5ziUMRuLzrRwod5iOPCCLwX/IfWQ0uB3zT4
rcEgHD/E64To6Moyd878o9vfx3M0mmcrMcAtoIayWqioi2GCEUdfrMc3siRTAafJ
1l4iKJZSdYOgKMihucuZ9ufszueQ6DwihUfgzP9jTSquOLLanrsaapW4OG8ZAx4+
wzCh13pKEb0ppOB1QyohSFWnQ/O1H+aN0jVtZ8VUEPwmPs0RMOM=
=r21R
-----END PGP SIGNATURE-----

3
SRC/patches/README Normal file
View File

@@ -0,0 +1,3 @@
Place any patch files here and preface each with a
number indicating the order of execution. Patch
files are expected to use a .patch extension.