PIKT

Samples: Named Configuration File

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


In this named_conf_files.cfg example, we specify some named configurations.  Note how, by means of the '#if dnsmaster ... #elif dnsslave ... #endif' directives, we customize the configuration for each master and slave name server.

///////////////////////////////////////////////////////////////////////////////
//
// named_conf_files.cfg
//
///////////////////////////////////////////////////////////////////////////////

#if dnsserver

named.conf
        path "/etc/named.conf"  mode 640 uid =rootuid gid 44

        # Copyright (c) 2001-2003 SuSE Linux AG, Nuernberg, Germany.
        # All rights reserved.

[...]
        
        options {
        
                # The directory statement defines the name server's
                # working directory
        
                directory "/var/lib/named";
        
[...]
        
        # The following zone definitions don't need any modification.
        # The first one is the definition of the root name servers.
        # The second one defines localhost while the third defines the
        # reverse lookup for localhost.
        
        zone "." in {
                type hint;
                file "db.cache";
        ##      file "root.hint";
        };
        
        zone "localhost" in {
                type master;
                file "db.localhost";
        ##      file "localhost.zone";
        };
        
        zone "0.0.127.in-addr.arpa" in {
                type master;
                file "db.127.0.0";
        ##      file "127.0.0.zone";
        };
        
[...]
        
        # pikt
        
        zone "pikt.org" in {
#if dnsmaster
                type master;
                file "master/db.pikt.org";
#elif dnsslave
                type slave;
                file "slave/db.pikt.org";
                masters { 192.168.2.132; };
#endif
        };
        
        zone "pikt.net" in {
#if dnsmaster
                type master;
                file "master/db.pikt.net";
#elif dnsslave
                type slave;
                file "slave/db.pikt.net";
                masters { 192.168.2.132; };
#endif
        };
        
        # earlymusichicago
        
        zone "earlymusichicago.org" in {
#if dnsmaster
                type master;
                file "master/db.earlymusichicago.org";
#elif dnsslave
                type slave;
                file "slave/db.earlymusichicago.org";
                masters { 192.168.2.132; };
#endif
        };
        
        zone "earlymusichicago.com" in {
#if dnsmaster
                type master;
                file "master/db.earlymusichicago.com";
#elif dnsslave
                type slave;
                file "slave/db.earlymusichicago.com";
                masters { 192.168.2.132; };
#endif
        };
        
[...]

#endif

///////////////////////////////////////////////////////////////////////////////
On the piktmaster system, we would install the named.conf file to both master and slave name server system with, for example:
# piktc -iv +F named.conf +H dnsserver        [or: ... +H dnsmaster dnsslave]

[For more examples, see Samples.]


Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

DNS for Dummies
DNS for Dummies

Hacking Exposed: Network Security Secrets & Solutions
Hacking Exposed: Network Security Secrets & Solutions

Ethereal Packet Sniffing
Ethereal Packet Sniffing

Honeypots: Tracking Hackers
Honeypots: Tracking Hackers

The Best Damn Firewall Book Period
The Best Damn Firewall Book Period