LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   BIND/named Startup Error - named.root:1: '}' expected near ';' (https://www.linuxquestions.org/questions/linux-server-73/bind-named-startup-error-named-root-1-%7D-expected-near-%3B-681602/)

acutchin 11-06-2008 02:15 PM

BIND/named Startup Error - named.root:1: '}' expected near ';'
 
I am getting a strange error when trying to start named. I have searched the web and some of the boards, but have not found any useful information except to verify that all your braces are closed in named.conf. I have visually checked this a hundred times now, and still have the error. Please review my configs and tell me if I've missed something!

Here is the error:

=======================================================
[root@my-server named]# service named start
Starting named:
Error in named configuration:
/etc/named/named.root:1: '}' expected near ';'
[FAILED]
=======================================================

Here is my packages:

=======================================================
[root@my-server named]# rpm -qa | grep bind
bind-utils-9.3.4-6.0.2.P1.el5_2
bind-9.3.4-6.0.2.P1.el5_2
bind-libs-9.3.4-6.0.2.P1.el5_2
=======================================================

My named.conf (anonymized personal info):

=======================================================
options {
listen-on port 53 {
127.0.0.1;
};
listen-on port 53 {
1.2.3.4;
};
directory "/var/named";
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";
allow-query {
localhost;
};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients {
localhost;
};
match-destinations {
localhost;
};
recursion yes;
include "/etc/named/named.root";
include "/etc/named/named.rfc1912.zones";
};
key ddns_key {
algorithm hmac-md5;
secret "use /usr/sbin/dns-keygen to generate TSIG keys";
};
view "external" {
match-clients {
any;
};
match-destinations {
any;
};
recursion no;
include "/etc/named/named.root";
zone "mydomain.com" {
type master;
file "mydomain.com.master.zone";
};
};
=======================================================

My named.root file (copied from internic.net)

=======================================================
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . <file>"
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC
; under anonymous FTP as
; file /domain/named.root
; on server FTP.INTERNIC.NET
; -OR- RS.INTERNIC.NET
;
; last update: Feb 04, 2008
; related version of root zone: 2008020400
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; operated by VeriSign, Inc.
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30
;
; operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1
;
; operated by ICANN
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42
;
; operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35
; End of File
=======================================================

Thanks in advance for any insight you can offer!

-- acutchin

trickykid 11-06-2008 02:26 PM

I would imagine that the named.root doesn't get an include from the named.conf but rather this file goes into your zone file location. Since it's complaining about the lack of ; in the file, which it isn't, it's a zone file, not a conf file.

acutchin 11-06-2008 07:43 PM

Thanks for your help, trickykid, but I don't think that's the issue. Look at the Bind 9.3.4 sample named.conf file:

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

As you can see, you are supposed to include it in every view, apparently by absolute path. The sample doesn't place it in /var/named, and doesn't define it with a "zone" statement.

chort 11-10-2008 01:41 AM

Well if you read the BIND admin manual, you'd see that include simply inserts configuration information from another file, i.e. it has to be valid named.conf syntax, not zone file syntax. What you're supposed to include is the '.' zone configuration. Here's a sample from CentOS:
PHP Code:

//
//   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";
}; 

The clue is complaining about wanting '}' before ';', which points to named.conf syntax where ';' is used to close a statement and "//" is the start of a comment. In zone files, ';' is the start of a comment (such as line #1 in your root zone, which is exactly what the error said).

trickykid 11-10-2008 09:43 AM

Exactly what chort pointed out and myself, sorry if I wasn't as clear before. You're trying to load a zone file as a conf file.


All times are GMT -5. The time now is 02:56 PM.