From: roberson@hamer.ibd.nrc.ca (Walter Roberson)
Newsgroups: comp.sys.sgi.admin
Subject: Re: Help with setting up nameserver
Date: 4 Oct 1995 03:53:20 GMT
Organization: National Research Council of Canada
Message-ID: <44t0fg$2po@canopus.cc.umanitoba.ca>
References: <steveyum-2909951100040001@192.0.2.1>

In article <steveyum-2909951100040001@192.0.2.1>, Stephen Yum <steveyum@netcom.com> wrote:
:The problem is that I have to have the Indy be the name server (as well as
:the HTTP server) that can resolve the domain name for the Macs/PCs. So
:essentially, my problem is with setting up a domain name server that
:points to itself for everything.
[for a specialized LAN-only access reason]

The instructions below also are useful for putting together the nameserver
files when you -do- want outside systems to be accessed.


Start by installing eoe2.sw.named .  Then cd /var/named/mkdns

Create a small script named 'domainname' that just prints the name of
the domain you have assumed (eg,    echo us.oursite.us   )
This is needed if you do not have NIS installed. (This could be
considered a bug in the routines, as they are intended to work even
in the absense of NIS.)

In the below, set FULLDOMAIN to the local domain (eg, 'ibd.nrc.ca')
and SUBDOMAIN to the lowest level subdomain (eg, 'ibd')
# echo "echo $FULLDOMAIN" > domainname
# chmod +x domainname
# PATH=$PATH:. export PATH
# cp subfoo.soa /var/named/$SUBDOMAIN.soa
# cp subfoo.hosts.soa /var/named/$SUBDOMAIN.hosts.soa

Edit /etc/resolv.conf . For your purpose, you would want

# cat /etc/resolv.conf
hostresorder bind
nameserver xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the ip address of the indy.
If you wanted to use a backup server (in case named fell over?), you would
add additional 'nameserver' lines, up to three total. The 'nameserver'
lines are most useful when you are not running named at all.


For compatibility with old programs,
# ln -s /etc/resolv.conf /usr/etc/resolv.conf


Now, edit /var/named/$SUBDOMAIN and /var/named/$SUBDOMAIN.hosts.soa
to set items such the contact name and the MX . Edit /etc/named.boot --
see below for more on this.

Warning: The mkdns script does not know about trailing comments in /etc/hosts,
so you might need to strip them off, eg,

# sed -e 's/ *#.*$//' /etc/hosts > /tmp/hosts
# ./mkdns -t -i /tmp/hosts

Examine /var/named/$SUBDOMAIN.hosts.new and /var/named/SUBDOMAIN.*.rev.new
and make sure they are okay. If not, edit the prototypes and use
options to the mkdns script as needed until they are right.


Once the files look right, run mkdns without the -t (test) option.


For your special application of wanting to handle all nameserver
queries, you should set your /etc/named.boot so that you have no
'forwarders' line, and no 'cache' line. Without the 'cache' line there
will be no way for the resolver to know about outside sites by default,
and without a 'forwarders' line, the resolver will not automatically
ask another system for its opinion before trying what's in the cache.



[For readers wanting to set up a valid root cache, the official source
at the moment seems to be NIC.DDN.MIL in the file netinfo/root-servers.txt
The NIC file is, though, not in a format suitable for use as a cache,
at least not with older versions of 'named'. Here's a copy of the
reformatted version:

===
# cat root.cache
;
;       root.cache      October 1995
;
;       The most up-to-date list is available via anonymous FTP from
;       NIC.DDN.MIL in the file netinfo/root-servers.txt.
;
; Initial cache data for root domain servers.
;

; the dot at the beginning of the next line is very important!

. 99999999 IN NS A.ROOT-SERVERS.NET.
  99999999 IN NS B.ROOT-SERVERS.NET.
  99999999 IN NS C.ROOT-SERVERS.NET.
  99999999 IN NS D.ROOT-SERVERS.NET.
  99999999 IN NS E.ROOT-SERVERS.NET.
  99999999 IN NS F.ROOT-SERVERS.NET.
  99999999 IN NS G.ROOT-SERVERS.NET.
  99999999 IN NS H.ROOT-SERVERS.NET.
  99999999 IN NS I.ROOT-SERVERS.NET.

;
;  Prep the cache (hotwire the addresses).  Order does not matter
;

A.ROOT-SERVERS.NET. 99999999 IN A            198.41.0.4
B.ROOT-SERVERS.NET. 99999999 IN A            128.9.0.107
C.ROOT-SERVERS.NET. 99999999 IN A            192.33.4.12
D.ROOT-SERVERS.NET. 99999999 IN A            128.8.10.90
E.ROOT-SERVERS.NET. 99999999 IN A            192.203.230.10
F.ROOT-SERVERS.NET. 99999999 IN A            39.13.229.241
G.ROOT-SERVERS.NET. 99999999 IN A            192.112.36.4
H.ROOT-SERVERS.NET. 99999999 IN A            128.63.2.53
I.ROOT-SERVERS.NET. 99999999 IN A            192.36.148.17
===
]

[Our functioning /etc/named.boot file ends up looking like this:
===
# cat /etc/named.boot
;
;  @(#)named.boot       1.3     (Berkeley)  86/01/30
;
;  boot file for primary name server
;
; type          domain                  source file or host
;
directory                                       /var/named
primary         0.0.127.IN-ADDR.ARPA            localhost.rev
forwarders      130.179.16.8 132.246.160.2
cache           .                               root.cache
; do not delete this 1st line--generated by mkdns
primary   ibd.nrc.ca                     ibd.hosts
primary   172.70.192.IN-ADDR.ARPA        ibd.172.70.192.rev
; do not delete this 2nd line--generated by mkdns
===
]

    Walter Roberson                roberson@Ibd.nrc.ca
