nixCraft Poll

Topics

Check BIND - DNS Server configuration file for errors with named-checkconf tools

Posted by Vivek Gite [Last updated: October 12, 2007]

You can use a tool called named- checkconf to check BIND dns server (named daemon) configuration file syntax under Linux / UNIX. It checks the syntax, but not the semantics, of a named configuration file i.e. it can check for syntax errors or typographical errors but cannot check for wrong MX / A address assigned by you. Nevertheless, this is an excllent tool for troubleshooting DNS server related problems.

How do I check my bind configuration for errors?

Simply run command as follows:
# named-checkconf /etc/named.conf
You may want to chroot to directory so that include directives in the configuration file are processed as if run by a similarly chrooted named:
# named-checkconf -t /var/named/chroot /etc/named.conf
If there is no output, the configuration is considered correct and you can safely restart or reload bind configuration file. If there is an error it will be displayed on screen:
# named-checkconf /etc/named.conf
Output:

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

Related tool: BIND-DNS server zone file validity checking tool

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Fabio Viero Says:

    also there“s named-checkzone to check zone files for typos, syntax errors and the like. Command syntax is as follows:

    named-checkzone

    Example for a zone domain.com with a zone file named domain.com.zone

    named-checkzone domain.com domain.com.zone

  2. Balwinder S Dheeman Says:

    There also exists a dlint; a DNS Lint and even a dnstracer too ;)

  3. John Doe Says:

    DNS N00B

    I cannot get my bind service to start. When I type:
    [root@localhost ~]# /etc/init.d/named start
    Starting named:
    Error in named configuration:
    /etc/named.conf:58: open: /etc/named.root.hints: file not found
    [FAILED]

    What do I need to do to make the file appear in the correct directory. If I do:

    [root@localhost ~]# locate named.root.hints
    /usr/share/doc/bind-9.3.4/sample/etc/named.root.hints

    The file seems to be in the directory above.

  4. vivek Says:

    Do you run named in chroot jail? Can you tell me your Linux distro name?

  5. John Doe Says:

    It is fedora 6 with all the lastest updates. Yes, it should be in chroot by default. It all started with this article:

    I was hoping to get it set up and running. Here is my version:

    [root@localhost ~]# rpm -q bind-chroot
    bind-chroot-9.3.4-7.P1.fc6
    [root@localhost ~]#

    When I tried to backup things by doing:

    [root@bigboy tmp]# cp -f /etc/named.conf /var/named/chroot/etc/
    [root@bigboy tmp]# cp -f /etc/rndc.* /var/named/chroot/etc/

    It could not find the file locations and so I located them and typed in different ones. I’m not sure if that would have thrown it off?

    Is there someway just to remove it all and start over again? I tried removing and installing the graphical way through KDE but everything remains the same when I try to start named again.

    Thanks,

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.