Please note that all names and numbers in these examples have been changed for
security reasons. These are examples and are not exact copies of the files used on
our subnet.
It is important to note that FreeBSD 2.2.* uses a different version of named
than FreeBSD 3.*. In fact, the configuration file is a different name. named.boot
is for FreeBSD 2.2.* (BIND 4) and named.conf is for FreeBSD 3.*.
The zone files
The following files collectively define the zones of our
subnet.
named.boot should already exist on your system. The other files will
be created as needed. I suggest you substitute your own domain name for the dvl
portion of the file names. The named.localhost and named.locahost.rev
files can be copied to your system unchanged from this example.
The above files are referred to as zone files and I've provided copies of mine below.
Use this example if you are using BIND 4 (FreeBSD 2.2.*), otherwise, use /etc/namedb/named.conf.
This file is referred to by an entry
in /etc/rc.conf. See the Starting the DNS Server
section of the PPP - Pedantic PPP
Primer for details. In effect, the following entries tell DNS where to find more
information.
You should subtitute your own domain for www.example.org but remember to retain
the periods where they occur. They are very important.
Use this example if you are using BIND 8 (FreeBSD 3.*), otherwise, use named.boot. I suggest you use the default
file and then add to it using the following as an example.
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "localhost.rev";
};
zone "www.example.org" {
type master;
file "named.www.example.org";
};
zone "0.0.10.in-addr.arpa" {
type master;
file "www.example.org.rev";
};
The file /etc/namedb/make-localhost will create a localhost file for you.
Try typing:
This file defines the FreeBSD box as the name server for this domain. It also
provides the IP addresses for each box within this subnet.
@ IN SOA www.example.org. root.freebsd.www.example.org. (
961230 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS freebsd.www.example.org.
;
; Define the rest of the subnet
;
freebsd.www.example.org. IN A 10.0.0.10 ; The FreeBSD box
nt2.www.example.org. IN A 10.0.0.2 ; The 486
nt1.www.example.org. IN A 10.0.0.1 ; The Pentium
This file defines which host belongs to what IP address. You will notice that
the section in named.boot which refers to this file contains the phrase "0.0.10.IN-ADDR.ARPA".
If you reverse the numbers at the front of that phrase and then append the number
you find below, you get the address of the host in question. For example, 10.0.0.1
is the IP address assigned to NT1.
@ IN SOA www.example.org. root.freebsd.www.example.org. (
961230 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS freebsd.www.example.org.
10 IN PTR freebsd.www.example.org.
1 IN PTR nt1.www.example.org.
2 IN PTR nt2.www.example.org.
This file defines the localhost entry, 127.0.0.1. This is a well-defined
loopback for all hosts.
@ IN SOA www.example.org. root.freebsd.www.example.org. (
961230 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS freebsd.www.example.org.
localhost. IN A 127.0.0.1
As with the named.dvl.rev file, the section in named.boot which
refers to this file contains the phrase "0.0.127.IN-ADDR.ARPA".
When reversed and prefixed to the entry below, we find that 127.0.0.1 is localhost.
@ IN SOA www.example.org. root.freebsd.www.example.org. (
961230 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS freebsd.www.example.org.
1 IN PTR localhost.