LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2010, 05:10 AM   #1
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Rep: Reputation: 0
Unhappy Error when starting BIND in Webmin


Hello, I just finished configuring my BIND DNS server through the Webmin interface.

When I try to start BIND, I get the following error:
Code:
Failed to start BIND : Starting named: Error in named configuration: /etc/named.conf:43: '{' expected near 'in' [FAILED]
This is the named.conf configuration file:
Code:
// 
// named.conf 
// 
// Provided by Red Hat bind 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. 
// 
 
options { 
	directory 	"/var/named"; 
	listen-on { 127.0.0.1; 172.32.1.0/24; }; 
#	dump-file 	"/var/named/data/cache_dump.db"; 
#        statistics-file "/var/named/data/named_stats.txt"; 
	/* 
      * If there is a firewall between you and nameservers you  
want 
      * to talk to, you might need to uncomment the query- 
source 
      * directive below.  Previous versions of BIND always  
asked 
      * questions using port 53, but BIND 8.1 uses an  
unprivileged 
      * port by default. 
      */ 
#	query-source address * port 53; 
#        listen-on port 53 { 127.0.0.1; 172.32.1.2; }; 
#	allow-query { 127.0.0.1; 172.0.0.1; 172.32.1.0/24; 172.16.10.0/24; }; 
#}; 
 
#include "/etc/rndc.key"; 
 
#include "/etc/named.rfc1912.zones"; 
#}; 
}; 
server 172.32.1.2 { 
	keys { 
		rndckey;  
             }; 
}; 
 
view "everyone" { 
	zone "linuxserver.radisson.local" in in { 
		type master; 
		file "linuxserver.radisson.local.hosts"; 
		}; 
	zone "." IN in { 
		type hint; 
		file "named.root"; 
		}; 
	};
Can someone help me figure out what I need to change in the file??
 
Old 03-30-2010, 05:47 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Quote:
...
view "everyone" {
zone "linuxserver.radisson.local" in in {
type master;
...
You have 2 "in" in the above snippet. Delete one of them and should bo ok.

Regards
 
Old 03-30-2010, 05:52 AM   #3
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Original Poster
Rep: Reputation: 0
I did as you said but I got a different error this time:
Code:
Failed to start BIND : Starting named: Error in named configuration: /etc/named.conf:47: '{' expected near 'in' [FAILED]
 
Old 03-30-2010, 06:02 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
The same goes here. Go to line 47 (as shown by the error you get):
Quote:
zone "." IN in {
and remove the redundant "in"
 
Old 03-30-2010, 06:16 AM   #5
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Original Poster
Rep: Reputation: 0
Okay, I removed that one as well, then when I try to start it, I get this:
Quote:
Failed to start BIND : Starting named: error in named configuration: /etc/rndc.key:1: unknown option 'key' [FAILED]
This is what I have in rndc.key:
Quote:
key "rndckey" {
algorithm hmac-md5;
secret "YP9jE5FAoqf85wvSqtQ3wA==";
};
It's referring to the first line, but I don't understand why "key" is wrong?
 
Old 03-30-2010, 07:05 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Quote:
#include "/etc/rndc.key";
You have to uncomment the above line.
Also better change:
Quote:
server 172.32.1.2 {
keys {
rndckey;
};
};
with
Code:
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
I guess that 172.32.1.2 is the public ip of your server. It's better though to use localhost.

You will also need a /etc/rmdc.conf containing:
Code:
options {
default-server localhost;
default-key    rndckey;
};
include "/etc/rndc.key";
 
Old 03-31-2010, 03:09 AM   #7
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Original Poster
Rep: Reputation: 0
Hello again, I made the changes you recommended (only I used 127.0.0.1, instead of localhost) and this is the message that appears when I start rndc:
Quote:
rndc: connect failed: 127.0.0.1#953: connection refused
If I try to start named, I get this:
Quote:
Starting named:
Error in named configuration:
/etc/named.conf:57: unknown key 'rndckey'
[FAILED]
Here's the new updated configuration files:

named.conf
Quote:
//
// named.conf
//
// Provided by Red Hat bind 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.
//

options {
directory "/var/named";
# dump-file "/var/named/data/cache_dump.db";
# statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you
want
* to talk to, you might need to uncomment the query-
source
* directive below. Previous versions of BIND always
asked
* questions using port 53, but BIND 8.1 uses an
unprivileged
* port by default.
*/
# query-source address * port 53;
# listen-on port 53 { 127.0.0.1; 172.32.1.2; };
# allow-query { 127.0.0.1; 172.0.0.1; 172.32.1.0/24; 172.16.10.0/24; };
#};

include "/etc/rndc.key";

#@include "/etc/named.rfc1912.zones";
#};
forwarders {
172.32.1.2;
};
query-source-v6 address * port *;
query-source address * port *;
};

view "everyone" {
zone "linuxserver.radisson.local" in {
type master;
file "linuxserver.radisson.local.hosts";
};
zone "." IN {
type hint;
file "named.root";
};
};
key rndc-key {
algorithm hmac-md5;
secret "Kxf6MhYissYNy1X/oHqeNQ==";
};
controls {
inet 127.0.0.1 allow { 127.0.0.1; } keys { rndckey; };
};
rndc.conf
Quote:
# Start of rndc.conf
key "rndckey" {
algorithm hmac-md5;
secret "Kxf6MhYissYNy1X/oHqeNQ==";
};

options {
default-key "rndckey";
default-server 127.0.0.1;
};
include "/etc/rndc.key";
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndckey" {
# algorithm hmac-md5;
# secret "Kxf6MhYissYNy1X/oHqeNQ==";
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { "rndckey"; };
# };
# End of named.conf
Also, for some reason the rndc.key file is blank now.
 
Old 03-31-2010, 03:50 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
It is supposed that your distro already had a /etc/rndc.key, that's why there were those include statements.
Anyway since you've used the contents of rndc.key inside /etc/named.conf and /etc/rndc.conf, then you can delete the "include /etc/rndc.key" from both files.
Also note that the key name must be the same in both files, so in named.conf replace:
Quote:
key rndc-key {
with
Code:
key rndckey {
 
Old 03-31-2010, 04:21 AM   #9
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Original Poster
Rep: Reputation: 0
I commented the include key line in both files, and I changed rndc-key to rncdkey.

Now when I start named I get this:
Quote:
Starting named: [FAILED]
When I start rndc I get:
Quote:
rndc: connect failed: 127.0.0.1#953: connection refused
 
Old 03-31-2010, 04:30 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Without more info it's impossible to say what the problem is.
You should check the logs in /var/log and see why named startup fails.
 
1 members found this post helpful.
Old 03-31-2010, 05:09 AM   #11
frustratednewbie
LQ Newbie
 
Registered: Mar 2010
Distribution: Fedora 10
Posts: 16

Original Poster
Rep: Reputation: 0
Thumbs up

I copied the last part of the messages log file:
Quote:
Apr 1 01:25:49 linuxserver named[27147]: starting BIND 9.5.2-RedHat-9.5.2-1.fc10 -u named
Apr 1 01:25:49 linuxserver named[27147]: adjusted limit on open files from 1024 to 1048576
Apr 1 01:25:49 linuxserver named[27147]: found 2 CPUs, using 2 worker threads
Apr 1 01:25:49 linuxserver named[27147]: using up to 4096 sockets
Apr 1 01:25:49 linuxserver named[27147]: loading configuration from '/etc/named.conf'
Apr 1 01:25:49 linuxserver named[27147]: using default UDP/IPv4 port range: [1024, 65535]
Apr 1 01:25:49 linuxserver named[27147]: using default UDP/IPv6 port range: [1024, 65535]
Apr 1 01:25:49 linuxserver named[27147]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 1 01:25:49 linuxserver named[27147]: listening on IPv4 interface eth0, 172.32.1.2#53
Apr 1 01:25:49 linuxserver named[27147]: could not configure root hints from 'named.root': file not found
Apr 1 01:25:49 linuxserver named[27147]: loading configuration: file not found
Apr 1 01:25:49 linuxserver named[27147]: exiting (due to fatal error)
What I understand from this is that the problem is due to this 'named.root' file, which the daemon cannot find.

My question is, what is the function of named.root? Do I need to create one and place it in /var/named/ ?

---

Update! What I did was try to comment out the entire "." zone part of the named.conf file. Now named starts with no errors, and rndc seems to be running as well!

I just hope this hints root file isn't really vital..if so maybe I'll have to read up and check what it does.

Thanks for all the help bathory, really appreciate it!
 
Old 03-31-2010, 05:18 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,770

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Good to see it worked.
Quote:
Update! What I did was try to comment out the entire "." zone part of the named.conf file.
The hint zone is important. It lists the root servers that will respond to queries if your server (and the forwarders) fail.
To get a fresh named.root zone file, run:
Code:
 dig @a.root-servers.net . ns > named.root
Cheers

Last edited by bathory; 03-31-2010 at 07:29 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Webmin + BIND how to cheesewizz Linux - Networking 0 12-11-2008 02:13 AM
error installing BIND on webmin cgc2 Linux - Software 7 03-28-2008 03:26 PM
CentOS5: Error starting bind using chroot Ghostwheel Linux - Server 2 02-04-2008 12:48 PM
webmin bind zone bic Linux - Software 1 03-21-2007 12:10 PM
bind dns using webmin m61 Linux - Networking 1 01-16-2004 02:33 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration