LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   adding a zone in named.conf in centos 5.2 /etc/named.conf (http://www.linuxquestions.org/questions/linux-newbie-8/adding-a-zone-in-named-conf-in-centos-5-2-etc-named-conf-725800/)

coolhunkank 05-13-2009 08:02 PM

adding a zone in named.conf in centos 5.2 /etc/named.conf
 
I want to add following two zones in named.conf file.. bt it was missing and so i copied it from /usr/share/doc/bind-0.3.4/sample/etc/


FQDN(Fully Qualified Domain Name): mitcluster.mitgrid.chn.cdac.in

1. DNS Configuration:
--------------------

Add the following lines in /etc/named.conf file.
(Append the lines after zone "localdomain" IN)
step A:
zone "mitgrid.chn.cdac.in" IN {
type master;
file "mit.fwd";
allow-update { none; };
};

zone "2.16.172.in-addr.arpa" IN {
type master;
file "mit.rev";
allow-update { none; };
};


Note:
"mitgrid.chn.cdac.in" is a domain name of the host(Headnode).
"2.16.172.in-addr.arpa" is reverse value of the ipaddress of host. (Headnode)

step B:

Copy the localhost.zone into mit.fwd for our new domain name file format and then modify the mit.fwd

#cd /var/named/chroot/var/named
#cp localhost.zone mit.fwd

#mit.fwd file formate:

$ORIGIN .
$TTL 86400 ; 1 day
mitgrid.chn.cdac.in IN SOA mitcluster.mitgrid.chn.cdac.in. netops.cdac.ernet.in. (
2006011801 ; serial
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS mitcluster.mitgrid.chn.cdac.in.
$ORIGIN mitgrid.chn.cdac.in.
mitcluster A 172.16.2.100
mitnode01 A 172.16.2.1



Copy the named.local into mit.rev for our new domain name file format and then modify the mit.rev

#cd /var/named/chroot/var/named
#cp named.local mit.rev


#mit.rev file formate:

$ORIGIN .
$TTL 86400 ; 1 day
2.16.172.in-addr.arpa IN SOA mitcluster.mitgrid.chn.cdac.in. netops.cdacindia.com. (
2006011801 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS scorpion-proxy1.cdac.ernet.in.
NS mitcluster.mitgrid.chn.cdac.in.
$ORIGIN 2.16.172.in-addr.arpa.
100 PTR mitcluster.mitgrid.chn.cdac.in.
1 PTR mitnode01.mitgrid.chn.cdac.in.

######################################################################

Following are the files that i copied:
/usr/share/doc/bind-9.3.4/sample/etc/named.conf


//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
query-source port 53;
query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";

};
logging
{
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named).
* By default, SELinux policy does not allow named to modify the /var/named directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//
view "localhost_resolver"
{
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
* If all you want is a caching-only nameserver, then you need only define this view:
*/
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
# all views must contain the root hints zone:
include "/etc/named.root.hints";

/* these are zones that contain definitions for all the localhost
* names and addresses, as recommended in RFC1912 - these names should
* ONLY be served to localhost clients:
*/
include "/etc/named.rfc1912.zones";
};
view "internal"
{
/* This view will contain zones you want to serve only to "internal" clients
that connect via your directly attached LAN interfaces - "localnets" .
*/
match-clients { localnets; };
match-destinations { localnets; };
recursion yes;
// all views must contain the root hints zone:
include "/etc/named.root.hints";

// include "named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.

// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :

zone "my.internal.zone" {
type master;
file "my.internal.zone.db";
};
zone "my.slave.internal.zone" {
type slave;
file "slaves/my.slave.internal.zone.db";
masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
// put slave zones in the slaves/ directory so named can update them
};
zone "my.ddns.internal.zone" {
type master;
allow-update { key ddns_key; };
file "slaves/my.ddns.internal.zone.db";
// put dynamically updateable zones in the slaves/ directory so named can update them
};
};
key ddns_key
{
algorithm hmac-md5;
secret "use /usr/sbin/dns-keygen to generate TSIG keys";
};
view "external"
{
/* This view will contain zones you want to serve only to "external" clients
* that have addresses that are not on your directly attached LAN interface subnets:
*/
match-clients { !localnets; !localhost; };
match-destinations { !localnets; !localhost; };

recursion no;
// you'd probably want to deny recursion to external clients, so you don't
// end up providing free DNS service to all takers

// all views must contain the root hints zone:
include "/etc/named.root.hints";

// These are your "authoritative" external zones, and would probably
// contain entries for just your web and mail servers:

zone "my.external.zone" {
type master;
file "my.external.zone.db";
};
};

#######################################################################
/usr/share/doc/bind-9.3.4/sample/var/named/named.root


; <<>> DiG 9.5.0b2 <<>> +bufsize=1200 +norec NS . @a.root-servers.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7033
;; flags: qr aa; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 20

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 518400 IN NS D.ROOT-SERVERS.NET.
. 518400 IN NS E.ROOT-SERVERS.NET.
. 518400 IN NS F.ROOT-SERVERS.NET.
. 518400 IN NS G.ROOT-SERVERS.NET.
. 518400 IN NS H.ROOT-SERVERS.NET.
. 518400 IN NS I.ROOT-SERVERS.NET.
. 518400 IN NS J.ROOT-SERVERS.NET.
. 518400 IN NS K.ROOT-SERVERS.NET.
. 518400 IN NS L.ROOT-SERVERS.NET.
. 518400 IN NS M.ROOT-SERVERS.NET.
. 518400 IN NS A.ROOT-SERVERS.NET.
. 518400 IN NS B.ROOT-SERVERS.NET.
. 518400 IN NS C.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:ba3e::2:30
B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
F.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2f::f
G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
H.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:1::803f:235
I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
J.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:c27::2:30
K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
K.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:7fd::1
L.ROOT-SERVERS.NET. 3600000 IN A 199.7.83.42
M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
M.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:dc3::35

;; Query time: 110 msec
;; SERVER: 198.41.0.4#53(198.41.0.4)
;; WHEN: Tue Feb 26 15:05:57 2008
;; MSG SIZE rcvd: 615

#####################################################################
/usr/share/doc/bind-9.3.4/sample/var/named/named.local

$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.


######################################################################
/usr/share/doc/bind-9.3.4/sample/var/named/named.rfc1912.zones
// named.rfc1912.zones:
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};

#########################################################################

/usr/share/doc/bind-9.3.4/sample/var/named/localhost.zone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS @
IN A 127.0.0.1
IN AAAA ::1


########################################################################

/usr/share/doc/bind-9.3.4/sample/var/named/localdomain.zone
$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1


####################################################################
/usr/share/doc/bind-9.3.4/sample/var/named/named.broadcast
$TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost.

##################################################################

/usr/share/doc/bind-9.3.4/sample/var/named/named.root.hints
//
// The 'named.root' root cache hints zone for the bind DNS 'named' nameserver.
//
// named's cache must be primed with the addresses of the root zone '.' nameservers.
// The root zone file can be obtained by querying the root 'A' nameserver:
// $ dig . ns @198.41.0.4 > named.root
// Or by download via FTP / HTTP:
// $ wget ftp://ftp.rs.internic.net/domain/named.root
//
// Every view that is to provide recursive service must include this zone.
//
zone "." IN {
type hint;
file "named.root";
};


####################################################################
/usr/share/doc/bind-9.3.4/sample/var/named/named.zero


$TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost.

########################################################################










how do i do it?

jstephens84 05-13-2009 10:23 PM

not sure what you are exactly needing or wanting but here goes.
create a zone in the following location. var/named/chroot/var/named/data/<yourdomain>.<com|net|biz>.zone, then add the information from above and modify as needed. then restart the named service.

coolhunkank 05-14-2009 09:45 AM

hey Stephens, I wanna thank u first 4 having replied to me.
Ok , now what I want is i wanna configure dns for forming a cluster using Beowulf Cluster.
So I was supposed to add zones to named.conf file. but it was missing. So I wanted to know where can i find this named.conf file, (apart from /usr/share/doc/bind-9.3.4/sample/etc/named.conf.

And I also want to know how named.conf can be configured or edited to make it suitable.

Thanking You in Advance.


All times are GMT -5. The time now is 10:16 PM.