Popular Post

Posted by : Unknown Tuesday, 8 May 2012

 DNS allows systems to look up host names, both within the private network and across the Internet. There are other ways of doing this, for example you could just run identical hosts files on all your machines. But somehow, this is more fun. In addition, Windows 95 machines examine their hosts databases in an odd order which makes using host tables difficult; the win95netbug FAQ rovides information on this, as well as help on how to reconfigure win95 to reorder the lookup order.
You can set up the DNS server on any Unix system. The standard Solaris 2.6 install comes with BIND 4.9.x, suitably altered to deal with the additional Solaris naming systems. However, 4.9.x seems to do a great deal of maintenance work at fairly random times. This is fine if you have a permanent connection, but not so fine with a dialup. As a result, I have got BIND 8.2 from the Internet Software Consortium and installed that instead.
As a result, I'm going to talk about BIND 8.2 here. The version of BIND which comes with Solaris 2.5.1 seems a lot more dialup friendly. So, if you are using an older version of Solaris, you can probably stay with the supplied version; the boot files are considerably different, however, so you will need to examine the documentation.


DNS Server Configuration

To configure the DNS server, you need to set up a number of (text) database files. The DNS server daemon (called named) first consults a boot file. This boot file tells the daemon to consult a series of further database files which gives it enough information to start serving names.

Choosing a Domain


Before setting up your DNS server, you will need to choose a domain name. Since nobody, except you, will accept your domain as a genuine domain (we hope) you have a reasonable amount of latitude over what domain names you can pick.
Since I work for AFS, I have decided to call my domain canberra.afs.net.au I am pretty certain that nobody else is going to use that name.
You'll have to decide what domain name to pick. As a suggestion, if you are connecting to ORAC, then a domain of might be a good idea. On the other hand, I haven't consulted ORAC about this, so it might not.

The Boot File


The boot file is consulted by named to on startup, so that initial options and data can be loaded. A sample /usr/local/etc/named.conf file for a server is shown in figure.





#
# Boot file for server solaris, primary server
# for flibble.orac.net.au.
#

options {
    directory "/var/named";
    forwarders {
        299.18.99.151;
        299.8.183.1;
    };
    forward first;
    dialup yes;
    heartbeat-interval 1440;
};

zone "." {
    type hint;
    file "named.ca";
};

zone "flibble.orac.net.au." {
    type master;
    file "private.hosts";
};

zone "3.5.10.in-addr.arpa." {
    type master;
    file "private.rev";
};

zone "0.0.127.in-addr.arpa." {
    type master;
    file "private.local";
};






directory



The directory in which the database files will be found. The /var/named directory is traditional, although inexplicable, since configuration files usually go under pathname/etc

forwarders

A list of IP addresses to forward queries to. This saves us from doing all the work of working down the domain tree when finding a domain. You can set your forwarders to the name servers supplied by your ISP.

forward

The forwarding behaviour. Queries are first forwarded to the addresses listed in forwarders. Only if no forwarding server responds will this server do its own work. Setting this option to only means that this server never does its own search.

dialup

Indicate that this is a dialup machine and that, therefore, maintenance work should be grouped together rather than done at any old time. This option is the main reason for my installing BIND.


heartbeat-interval


The interval (in minutes) between performing maintenance activities. This option is set, by default, to 60 minutes. Setting it to 1440 minutes means than maintenance is done once a day. 

zone
Data about a particular domain. The string in double quotes give the domain name, with . being the top-level, root domain. The name server is to be the master server for the domain flibble.orac.net.au (name to IP-address) and the networks 10.5.3 and 127.0.0 (IP-Address to name).
type
The type of domain data. hint means that the data is there so that the top-level domain servers can be found. master means that this is the master server for this domain.
file
The file to read the name server data from. These files are discussed below.
The /var/named/named.ca File

The server, when it is doing its own work, rather than forwarding, needs a start point for searching for domains. This file contains the IP addresses of the servers for the root domain name servers. The base version of this file. The first section of this file states that the name servers (NS) for the root domain (.) are the ones listed. The second section says, for each name server, what its IP-address (A) is. The numbers (518400 and 3600000) give the time-outs in seconds for these entries; these figures should be large enough for the time out not to be a problem.

;    Initial cache data for named servers
;    Servers
;
.            518400    IN    NS    D.ROOT-SERVERS.NET.
.            518400    IN    NS    E.ROOT-SERVERS.NET.
.            518400    IN    NS    I.ROOT-SERVERS.NET.
.            518400    IN    NS    F.ROOT-SERVERS.NET.
.            518400    IN    NS    G.ROOT-SERVERS.NET.
.            518400    IN    NS    A.ROOT-SERVERS.NET.
.            518400    IN    NS    H.ROOT-SERVERS.NET.
.            518400    IN    NS    B.ROOT-SERVERS.NET.
.            518400    IN    NS    C.ROOT-SERVERS.NET.
;
;    Addresses
;
D.ROOT-SERVERS.NET.    3600000    IN    A    128.8.10.90
E.ROOT-SERVERS.NET.    3600000    IN    A    192.203.230.10
I.ROOT-SERVERS.NET.    3600000    IN    A    192.36.148.17
F.ROOT-SERVERS.NET.    3600000    IN    A    192.5.5.241
G.ROOT-SERVERS.NET.    3600000    IN    A    192.112.36.4
A.ROOT-SERVERS.NET.    3600000    IN    A    198.41.0.4
H.ROOT-SERVERS.NET.    3600000    IN    A    128.63.2.53
B.ROOT-SERVERS.NET.    3600000    IN    A    128.9.0.107
C.ROOT-SERVERS.NET.    3600000    IN    A    102.33.4.12

This file contains the IP addresses of the private network.

;    Hosts file for domain flibble.orac.net.au.
;
;name    ttl    class    type    data
;
;    Source of authority
@        IN    SOA    solaris.flibble.orac.net.au. root.solaris.flibble.orac.net.au. (
                2000050201    ; Serial
                10800    ; Refresh - 3 hours
                3600    ; Retry - 1 hour
                432000    ; Expire - 1 week
                86400)    ; Minimum - 1 day
         IN    NS    solaris.flibble.orac.net.au.
;
;    Machines for the flibble.orac.net.au domain
;
;name    ttl    class    type    data
localhost       IN       A       127.0.0.1
solaris         IN       A       10.5.3.1
win95           IN       A       10.5.3.21
linux           IN       A       10.5.3.22

;
;    Aliases
;
mail            IN       CNAME   solaris
www             IN       CNAME   solaris
;
;    Domain mailing addresses
;
flibble.orac.net.au.    IN    MX    10    solaris.flibble.orac.net.au.
flibble.orac.net.au.    IN    A     10.5.3.1

IN

Internet. Indicates that we are talking about the Internet class of records. Supposedly, there are other possible classes here.

SOA

Source of Authority. This entry contains information on which machine is the primary name server for information about this domain (solaris.flibble.orac.net.au in this case) and who to contact in the case of trouble (root.solaris.flibble.orac.net.au). The serial number is used to indicate where changes have occurred. The other numbers give the time to expiry of the information broadcast by this name server. The serial numbers need to increase with each version of the file. A fairly common practice is to use YYYYMMDDVV with the year, month and day being the date of update and VV being the version number within the day. In the past, serial numbers of the form 1.2 were common, but this is now deprecated.

NS

Name Server. This line indicates that solaris.flibble.orac.net.au is the name server for this domain.

A

Address. These lines give the IP addresses of the various hosts.

CNAME

Canonical Name. These lines give canonical names (aliases) for various common names. These names are not strictly needed, but redirect requests to www.flibble.orac.net.au etc. to solaris.flibble.orac.net.au

MX

Mail Exchange This line gives the system to which mail addressed to user@flibble.orac.net.au should be sent to (solaris in this case). 

 The /var/named/private.rev file

This file allows ``reverse lookup.'' With this file, a system can get the name of a host from its IP address. A sample private.rev file. The PTR code allows an IP address.




;
;    Reverse address file for domain flibble.orac.net.au
;
;name    ttl    class    type    data
;
;    Source of authority
@        IN    SOA    solaris.flibble.orac.net.au. root.solaris.flibble.orac.net.au. (
                2000050201    ; Serial
                10800    ; Refresh - 3 hours
                3600    ; Retry - 1 hour
                432000    ; Expire - 1 week
                86400)    ; Minimum - 1 day
        IN    NS    solaris.flibble.orac.net.au.
;
;    Machines names
;
;name    ttl    class    type    data
1        IN    PTR    solaris.flibble.orac.net.au.
21        IN    PTR    win95.flibble.orac.net.au.
22        IN    PTR    linux.flibble.orac.net.au.

The /var/named/private.local file.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Copyright © Networking Skills