Get an error while trying to start DNS server

Hi Guys,

I am trying to configure DNS on ESX server.

Everything done but when I am trying to start the DNS, it gives me an error

[root@linux3 etc]# service named restart
Stopping named: [ OK ]
Starting named: 
Error in named configuration:
/etc/named.conf:42: when using 'view' statements, all zones must be in views
[FAILED]
[root@linux3 etc]# 

Help me out please.

Thanks in advance

/Sirvesh :wall:

Obviously it doesn't like something in your /etc/named.conf. Could you post it please?

Your output says to look at line 42 of your /etc/named.conf file...

Here is my named.conf ... have a look

Now it is line 58 as i have made some changes ... I have enter the logs ....

[root@linux3 log]# service named start
Starting named: 
Error in named configuration:
/etc/named.conf:58: when using 'view' statements, all zones must be in views
[FAILED]
[root@linux3 log]# 


[root@linux3 log]# cat /etc/named.conf 
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver 
// (as a localhost DNS resolver only). 
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on 
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 127.0.0.1; 10.141.228.58; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        pid-file        "/var/run/named/named.pid";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     {localhost; 10.141.228.0/24; };
        allow-query-cache { localhost; };
};
logging {
  channel default_file  { file "/var/log/named/default.log"  versions 3 size 5m; severity dynamic; print-time yes; };
  channel general_file  { file "/var/log/named/general.log"  versions 3 size 5m; severity dynamic; print-time yes; };
  channel database_file { file "/var/log/named/database.log" versions 3 size 5m; severity dynamic; print-time yes; };
  channel notify_file   { file "/var/log/named/notify.log"   versions 3 size 5m; severity dynamic; print-time yes; };
  channel queries_file  { file "/var/log/named/queries.log"  versions 3 size 5m; severity dynamic; print-time yes; };
  channel network_file  { file "/var/log/named/network.log"  versions 3 size 5m; severity dynamic; print-time yes; };

  category default  { default_file; };
  category general  { general_file; };
  category database { database_file; };
  category notify   { notify_file; };
  category queries  { queries_file; };
  category network  { network_file; };
};
//logging {
//        channel default_debug {
//                file "data/named.run";
//                severity dynamic;
//        };
//}
view localhost_resolver {
        match-clients      { localhost; };
        match-destinations { localhost; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};
zone "loop.net" IN {
        type master;
        file "loop.net.zone";
        allow-update { none; };
};
zone "228.141.10.in-addr.arpa" IN {
        type master;
        file "228.141.10.rev";
        allow-update { none; };
};

Is this empty line normal?

channel queries_file { file "/var/log/named/queries.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel network_file { file "/var/log/named/network.log" versions 3 size 5m; severity dynamic; print-time yes; };

category default { default_file; };
category general { general_file; };

Yes...

It is normal issue is start from this, zone is the line 58

zone "loop.net" IN {

---------- Post updated at 08:34 AM ---------- Previous update was at 08:29 AM ----------

Hi ,

This issue get resolved ...
via this

view localhost_resolver {
        match-clients      { localhost; };
        match-destinations { localhost; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
zone "loop.net" IN {
        type master;
        file "loop.net.zone";
        allow-update { none; };
};
zone "228.141.10.in-addr.arpa" IN {
        type master;
        file "228.141.10.rev";
        allow-update { none; };
};
};

But now I am in new mess .... While going to start DNS i got this error in /var/log/messages ..

Dec  2 18:54:33 linux3 named[28432]: starting BIND 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 -u named -t /var/named/chroot
Dec  2 18:54:33 linux3 named[28432]: found 1 CPU, using 1 worker thread
Dec  2 18:54:33 linux3 named[28432]: using up to 4096 sockets
Dec  2 18:54:33 linux3 named[28432]: loading configuration from '/etc/named.conf'
Dec  2 18:54:33 linux3 named[28432]: none:0: open: /etc/named.conf: permission denied
Dec  2 18:54:33 linux3 named[28432]: loading configuration: permission denied
Dec  2 18:54:33 linux3 named[28432]: exiting (due to fatal error)

---------- Post updated at 09:44 AM ---------- Previous update was at 08:34 AM ----------

Thanks to you guys ..

Issue resolved... :slight_smile:

Glad it's working.

For the benefit of future struggling googlers, how was this issue resolved? Only thing more annoying than googling a problem and finding an unanswered question is finding a problem that was solved but gives no information on how :wink:

Sure,

1st issue got resolve after adding the "ZONE" within "View".

2nd issue resolved after giving permission to named group to the file "named.conf"

Hope it will help. :slight_smile: :slight_smile: