LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 05-16-2007, 10:02 AM   #1
ELPDave
LQ Newbie
 
Registered: Feb 2007
Location: El Paso TX
Distribution: Linux FC 5
Posts: 22

Rep: Reputation: 15
BIND9 named conf error mesage


I have been trying to get BIND9 working on my Debian 4 installation and
have found the process frustrating.

Right now, BIND refuses to load because it claims to find a syntax
error in the named.conf file. The error message I get from /var/log
daemon.log is "missing ';' before include statement.

I have looked and look and cannot see where the error is.

Maybe I need a new set of eyes.

I have included the named.conf file below.

Could someone please look at the file - perhaps I'm
missing something.

Also I would like to say that whoever designed the BIND9 inplementation
in Debian made a mess of it. I use O'reilly's 5th edition of "DNS and BIND"
and this implentation ignores or makes a complicated mess out what should be
a fairly straight forward configuration and activation process.

Anyway, below is the named.conf from my installation.

Any help would be appreciated.

ELPDave

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
//
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
//
// prime the server with knowledge of the root servers
//
zone "." {
type hint;
file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/localhost.zone";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/0.0.127.IN-ADDR.ARPA";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};

// zone "com" { type delegation-only; };
// zone "net" { type delegation-only; };

// From the release notes:
// Because many of our users are uncomfortable receiving undelegated answers
// from root or top level domains, other than a few for whom that behaviour
// has been trusted and expected for quite some length of time, we have now
// introduced the "root-delegations-only" feature which applies delegation-only
// logic to all top level domains, and to the root domain. An exception list
// should be specified, including "MUSEUM" and "DE", and any other top level
// domains from whom undelegated responses are expected and trusted.
// root-delegation-only exclude { "DE"; "MUSEUM"; };
 
Old 05-16-2007, 10:18 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
I don't see any problem down to the includes. In fact I copied what you wrote into a test named.conf on my DNS server and ran a check. It didn't complain until it got to the include but only because the file you include doesn't exist here.

That makes me wonder if your real issue isn't another include statement inside of one of the files you're including.

Have you checked to see what is in?:
/etc/bind/named.conf.options and /etc/bind/named.conf.local

By the way - you don't have to start named to check the file. Look for the named-checkconf command. On my RedHat it is in /usr/sbin:
/usr/sbin/named-checkconf

In the directory where your named.conf is just type:
/usr/sbin/named-checkconf named.conf
 
Old 05-18-2007, 09:08 AM   #3
ELPDave
LQ Newbie
 
Registered: Feb 2007
Location: El Paso TX
Distribution: Linux FC 5
Posts: 22

Original Poster
Rep: Reputation: 15
BIND9 named conf error mesage

Thanks for your reply to my syntax problem. As you stated,
the problem was in the named.conf.options file. I was able to successfully
start bind. It reads the zone files, but will not resolve any addresses.
I suspect the problem is in the resolver. But here is where I run into problems
trying to trouble shoot.

My experience with BIND is in Red Hat and Fedora - which has a fairly straight forward
structure. It's easy to configure BIND - you edit the files, start it and you're in business.

But in Debian, files are scattered all over. Why do I need three conf files ? Why can't I
just directly edit the resolv.conf file and be done with it ?

Instead I find, for example, the resolv.conf file is three parts -
/etc/resolvconf/resolv.conf/base head & tail

Additionally, I get involved in trying to enter the 'dnsdomainname' because that fails
to resolve. How do I enter the FQDN name ?

So, do you have a procedure to troubleshoot the resolver ?

Another question, in Fedora you can run the setup utility and tell the boot process what
applications to start. In Debian, is this in /etc/default ? Is there a GUI app to manage that ?

Thanks

ELPDave
 
Old 05-18-2007, 07:13 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Ok, the include is solved, so I'll help you with the other problems you're having.

The Debian way is just that, the Debian way. I agree that in principle, it should sync up with what the O'reilly says, but there are many possible reasons why it doesn't. The Debian BIND setup is probably unchanged in several years. Just because they tell you not to add zones directly to named.conf doesn't mean that you cannot, just that the package maintainer feels that you should not. It makes much sense across the board to tell people not to mess up their named.conf, and simply add zones to the included local file. Again, if you don't like that, cool, then add them directly to named.conf, and test it out with the aforementioned named-checkconf, which along with its sister named-checkzone, can find 99% of your problems.

Secondly, if you're really unhappy with the Debian package, there is a simple fix. Move their named.conf somewhere just to be safe, and use one of the thousands of named.conf files that exist on the internet. An even better but more technical response would be to build your own BIND. To begin with, BIND 9.4.0 is now the official release from ISC, the makers of the BIND software. It has several great new features, like blocking access to the cache, and always improved functionality. Because of the way Debian works, it will probably be 6 months if not longer before BIND 9.4 makes it into stable. So download the tarball, ./configure, make, make install, and have at it. The Debian people tried to make a generic configuration that will work for most of the users most of the time, but not all of the people all of the time. If you don't like their setup, you're not dealing with Redmond WA people anymore, you can change everything as you see fit.

It seems like you're a little confused as to what named.conf does. All that does is list the nameservers that your box should use. You can add a default domain to search incomplete domain names in, but there isn't much else it does. A simple /etc/resolv.conf on a nameserver could be as simple as
Code:
search yourdomain.com
nameserver 127.0.0.1
That would tag yourdomain.com onto any non-FQDN, so saying ping beavis actually asks BIND for "ping beavis.yourdomain.com". You don't need to add a search line, but most people do that for their nameserver, just to allow short names.

Also, I don't know where the "3 resolv.confs" are coming from. I have many servers running Etch stable, and they all have only /etc/resolv.conf, and my laptop and desktop (both Sid) have only /etc/resolv.conf. I'm guessing you added some package that did that for some reason, but that is just a suspicion, not something I can back up with hard fact.

The FQDN for the nameserver would be set in the zonefile for the domain. Useing my earlier example of beavis.yourdomain.com, the way to do that would be to define beavis.yourdomain.com IN A 1.2.3.4 in the yourdomain.com file, and it isn't anything more than that.

Troubleshooting the resolver would be as simple as doing digs pointed at the localhost from the nameserver. Something like:
Code:
dig google.com @127.0.0.1
If it answers, it is working. If it doesn't, check if named is running with
Code:
ps aux| grep named
If that doesn't show anything, then named crashed for some reason, restart it.

Debian's /etc/default is more a question of what users/processes should be linked, like BIND starting as root, but running as named instead of root. The list of possible startups is in /etc/init.d, and it is different for each runlevel, which can be found in /etc/rcX.d/, where X = 1,2,3,4,5. The command update-rc.d can be used to alter where things startup in the boot process. If you installed BIND from the apt-get or aptitude tools, it will have all that installed, and running without human intervention. I hope and pray that all servers are GUI free, but we have too many people who think looking at pictures somehow helps them to manage servers. I would hope there isn't a graphical way to manipulate the startup scripts, but there probably is.

Peace,
JimBass
 
  


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
named.conf and named.caching-server.conf ? Ronin_tekorei Linux - Server 4 05-03-2007 08:34 AM
Annoying syntax error with named.conf d0ugb Linux - Networking 7 08-07-2005 01:20 PM
Error!! when running named.conf eckertc1 Linux - Networking 14 03-04-2005 08:01 PM
SUSE 9.1: named.conf works, but including separate conf files doesn't??? registering Linux - Distributions 0 06-09-2004 05:03 PM
cannot find named.conf and /var/named kaushikma Red Hat 1 02-07-2004 01:49 PM


All times are GMT -5. The time now is 12:32 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration