Date: Fri, 11 Oct 1996 00:32:26 +0000 () From: "Lenzi, Sergio" <lenzi@bsi.com.br> To: questions@freebsd.org Cc: freebsd@iqm.unicamp.br Subject: NAMED administration. Message-ID: <Pine.BSF.3.91.961011002847.557A-100000@sergio>
next in thread | raw e-mail | index | archive | help
Hello.
To all of you who is in need to make named to work and need to
build those "db" files, here is a shell script that "builds" a
working named "site" for you.
Your machine must be setted up with ip, and name in the /etc/hosts.
---------
#!/bin/sh
if [ ! -d /var/named ]
then
	mkdir /var/named
fi
cd /var/named
host=`hostname`
localip=`grep $host /etc/hosts | awk '{print $1}'`
lastiptok=`echo $localip | awk -F. '{print $4}'`
revip=`echo $localip | awk -F. '{printf "%d.%d.%d",$3,$2,$1}'`
localdomain=`echo $host | awk -F. '{print $2}'`
host=`echo $host | awk -F. '{print $1}'`
echo -n root name server ip:
read rootip
echo -n root name server name:
read nroot
cat > /etc/named.boot <<%
;
;	Boot file for name server
;
directory	/var/named
cache		.				cache
primary		$localdomain			db.$localdomain
primary		0.0.127.in-addr.arpa		db.local
primary		$revip.in-addr.arpa	$localdomain.rev
%
cat > cache <<%
; BIND data file for initial cache data for root domain servers.
;
$localdomain.		IN	NS	`hostname`.
br.			IN	NS	dixit.ansp.br.
.			IN	NS	$nroot.
;
;	ADDRESS
;
dixit.ansp.br.			IN	A	143.108.1.17
`hostname`.			IN	A	$localip
$nroot.				IN	A	$rootip
%
cat > db.$localdomain <<%
;
;	named definition for $localdomain 
;
@		IN	SOA	$host.$localdomain.	root.(
		1		; Serial
		3600		; Refresh
		300		; Retry
		3600000		; Expire
		3600 )		; Minimum
		NS		$host.$localdomain.
		MX	10	$host.$localdomain.
;
localhost	IN	A	127.0.0.1
$host		IN	A	$localip
\$INCLUDE	localnet
%
cat > db.local <<%
;
;	named.local 
;
@	IN	SOA	$host.$localdomain.	root.(
		18		; Serial
		3600		; Refresh
		300		; Retry
		3600000		; Expire
		3600 )		; Minimum
	IN	NS		$host.$localdomain.
1	IN	PTR		localhost.
%
cat > $localdomain.rev <<%
@	IN	SOA	$host.$localdomain.	root.(
		1		; Serial
		3600		; Refresh
		300		; Retry
		3600000		; Expire
		3600 )		; Minimum
	IN	NS		$host.$localdomain.
1	PTR		$host.$localdomain.
%
cat > /etc/resolv.conf <<%
domain	$localdomain
nameserver	127.0.0.1
%
-----------------
Sergio Lenzi.
Unix consult.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.961011002847.557A-100000>
