Troubleshoot Linux / UNIX bind dns server zone problems with named-checkzone tool

Q. How do I check my domain zone file for error and validity the same under BIND DNS Server version 9?

ADVERTISEMENTS

A. You need to use named- checkzone command as zone file validity checking tool. It is useful for checking zone files before configuring them into a name server.

named-checkzone command syntax

named-checkzone {zonename} {filename}
Where,

  • zonename : The domain name of the zone being checked.
  • filename : The name of the zone file.

How do I check my zone file configuration for errors?

Use named-checkzone to check the zone files as follows:
named-checkzone nixcraft.com /var/named/zone.nixcraft.com
Output:

OK

If you see “OK” as result, the zone file is properly configured and you can restart bind name server.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig 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 jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
9 comments… add one
  • trupti Oct 18, 2007 @ 5:05

    how to configure bind in enterprise linux

  • Satish Jul 23, 2008 @ 6:48

    Dear
    Tech. Team in my LINUX server DNS server is not configure properly and the package bind*cachi* is not install,pls how to solve that problem,rewmaining theis all package install properly.Pls send me the reply asap.

    Regards
    Satish Patnaik
    09985714525

  • linuxss Aug 26, 2008 @ 8:53

    Dear Satish,

    You copy or download bind package from internet which are not install in your system

  • ashish Feb 26, 2010 @ 10:10

    hello sir
    plz tell me
    sir i have one computer and i have to configure dns server in linux
    when i configure dns server in linux then get some error
    so pz tell me how to configure dns server properly

  • Bodhik Jun 18, 2010 @ 2:21

    Can we use named-checkzone for rev zone files, i.e. 100.100.100.rev?

  • Erik Apr 27, 2011 @ 9:40

    Yes we can, named-checkzone is used for both zone file and reverse zone file. It does same checking like bind does when starting.

  • Siva Nov 22, 2012 @ 14:16

    How Can I test the Reverse look up zone ??

  • Arvind Apr 11, 2015 @ 19:32

    In order to comment out a line in DNS zone file, will # work or only ; must be used.

  • Pugazhendhi_r Jun 3, 2015 @ 3:58

    How to check the #named-checkzone for all 2000 domains at once…

    When I check for one zone it is fine
    # named-checkzone zmspiderman.com.bn /var/named/zmspiderman.com.bn.hosts
    zone zmspiderman.com.bn/IN: loaded serial 1298339398
    OK
    =======================================================
    Please help me to check the zone config for all zone at once

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.