Named start problem

STEP 1:COPY sample named.conf

Search for the named.conf

Code:
locate named.conf

Output should be similar to:

Code:
/etc/dbus-1/system.d/named.conf
/usr/share/doc/bind-9.3.4/sample/etc/named.conf
/usr/share/logwatch/default.conf/services/named.conf
/usr/share/man/man5/named.conf.5.gz

The second line has a sample named.conf file. So lets use it..

Code:
cp /usr/share/doc/bind-9.3.4/sample/etc/named.conf /var/named/chroot/etc/named.conf

Security Note: You want to set the proper permissions on the named.conf file once you are done configuring.Step 1:

————————————————————————————

[root@localhost ~]# service named start

Locating //etc/named.conf failed:

                                                           [FAILED]

The above error shows that you need to place the “named.conf” file, the Bind configuration file, on the desired location in order to make it work. Locate the required file on your machine:

[root@localhost ~]# locate named.conf

/etc/dbus-1/system.d/named.conf

/usr/share/doc/bind-9.x.x/sample/etc/named.conf

/usr/share/logwatch/default.conf/services/named.conf

/usr/share/man/man5/named.conf.5.gz

You will get a list of paths, similar to the above list. Copy the “named.conf” at /usr/share/doc/bind-9.x.x path to the desired location.

In case the Bind is not chrooted, copy the file in /etc:

[root@localhost ~]# cp /usr/share/doc/bind-9.x.x/sample/etc/named.conf /etc/.

If the Bind id chrooted, copy the “named.conf” file in var/named/chroot/etc:

[root@localhost ~]# cp /usr/share/doc/bind-9.x.x/sample/etc/named.conf /var/named/chroot/etc.

Now, try to start Bind service, if you will get the following error:

[root@localhost ~]# service named start

Starting named:

Error in named configuration:

/etc/named.conf:57: open: /etc/named.root.hints: file not found

                                                           [FAILED]

Locate the “named.root.hints” file on the system:

[root@localhost ~]# locate  /etc/named.root.hints

/usr/share/doc/bind-9.x.x/sample/etc/named.root.hints

You will get a list or a single file path, copy the file in /usr/share/doc/bind-9.x.x to /etc, if Bind is not chrooted:
[root@localhost ~]# cp  /usr/share/doc/bind-9.x.x/sample/etc/named.root.hints /etc/.

If Bind is chrooted copy the file to:
[root@localhost ~]# cp  /usr/share/doc/bind-9.x.x/sample/etc/named.root.hints /var/named/chroot/etc/.

Try to start the Bind service now:

[root@localhost ~]# service named restart

Starting named:

Error in named configuration:

/etc/named.conf:63: open: /etc/named.rfc1912.zones: file not found

                                                           [FAILED]

Now, if you will get the above error, we need to remove some part of data from “named.conf” file. Remove this whole section in the copied “named.conf” file:

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”;
};
};

Now, start Bind service:

[root@localhost ~]# service named restart

Starting named:                                            [  OK  ]

Your Bind service will be running now.

Note: If you want to change chrooted Bind, simply comment the ROOTDIR line in /etc/sysconfig/named file and restart named service.

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: