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

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

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

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 13 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
13 comments… add one
  • Fabio Viero Sep 22, 2007 @ 1:53

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


    Example for a zone with a zone file named


  • Balwinder S Dheeman Sep 24, 2007 @ 19:07

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

  • John Doe Sep 26, 2007 @ 3:23

    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

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

    [root@localhost ~]# locate named.root.hints

    The file seems to be in the directory above.

    • Roshan Oct 4, 2011 @ 6:28

      copy the hints finle to /etc/ folder……and then restart the service.

  • 🐧 nixCraft Sep 26, 2007 @ 5:25

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

  • John Doe Sep 26, 2007 @ 22:51

    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
    [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.


  • Mohamed Dh. May 21, 2009 @ 14:46

    Dear Sir,

    I have problem starting named service, I get Starting Named: [FAILED]. Then I started to check bind configuratio using named-checkconf command, but there is no output. Please hel me.

  • Andy Nov 18, 2009 @ 10:43

    hi Vivek,
    i have a problem whenever i do a nslookup for a site named manalihospital it does not return an answer but after i restart the named process it works fine for some time and again the same problem persists, what can be the problem.
    thank you in advance


  • Zeeger Sep 27, 2012 @ 0:20

    I had the same problem: no error messages the service will restart fine but for some reason this new domain would not resolve.
    when I looked at my /var/log/messages I saw
    mail named[6722]: zone loading master file mydomainx2.domain: permission denied
    looking at the file under /var/named I saw that the owner for this particular file was root:root.
    Changing the owner to root:named and restarting the service worked.

  • tarunika Oct 29, 2012 @ 7:51


    Getting this error while restarting

    29-Oct-2012 00:32:43.667 ignoring config file logging statement due to -g option
    29-Oct-2012 00:32:43.667 couldn’t open pid file ‘/var/run/named/’: Permission denied
    29-Oct-2012 00:32:43.667 exiting (due to early fatal error)
    Error in configuration file /etc/named.conf : [FAILED]

    any suggestion…

  • Bapurao Mar 26, 2013 @ 22:31

    zone loading from master file failed: file not found
    zone not loaded due to errors.

  • Bapurao Mar 26, 2013 @ 22:33

    zone loading from master file failed: file not found
    zone not loaded due to errors.

    please give solution from last 2 weeks i trying to install DNS server but not find ans.

    looking forward to you
    Thanx in advance

  • Pravesh Sep 24, 2014 @ 14:54

    I am configuring dns in rhel6 but there is no file /named.root.key how to configure without this file or where to find the same file.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum