DNS BIND Tools: ndc and rndc

Networking
Tech Articles
DNS Bind Tools: ndc and rndc

The named service can be administered by these tools:
ndc use with BIND 8  (a shell script)
rndc use with BIND 9


rndc

The command usage is:
rndc [option...] command [command-option]
rdnc reload localhost

If rndc is invoked with no command line options or arguments, it prints a summary of the supported commands, the available options and their arguments.

You can also use rdnc to manage named on other servers. The appropriate settings must exist in /etc/named.conf.

Examples of rdnc commands

rdnc status
Checks the status of the name service. Sample output:
version: 9.7.0-P2-RedHat-9.6.0-5.P2.el6
CPUs found: 1
worker threads: 1
number of zones: 16
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

rndc querylog
Enables the query logging. Note: this is a toggle, so it will disable when already enabled. The queries are logged to /var/log/messages. As with all log files, you can follow these entries in real time with:
tail -f /var/log/messages


rndc refresh
rndc refresh petervtamas.com
Will cause a zone transfer (update of slave nameserver's database). Note that the slave nameserver will check serial numbers before initiating zone transfers. If the Systems Administrator does not update the serial number, the slave nameserver will assume its copy of the zone is current.

rdnc reload
This will reload the zones. All previously cached responses are kept. This allows changes to the zone files without losing all stored name resolutions.

rdnc reload petervtamas.com
Reloads a single zone.

rndc reconfig
Finally, to reload the configuration file and newly added zones only, type:

Configuration files

/etc/named.conf
The default configuration file for the named service.

/etc/rndc.conf
The default configuration file for the rndc utility. If the file does not exist, rndc will use /etc/rndc.key           

/etc/rndc.key           
The default key location. Generated automatically during the installation process using:
rndc-confgen -a





Suggestions for Future Learning

RedHat has a networking document with a nice section on DNS:

This is also a good article from RedHat:



DNS linux named ndc rndc




Networking
Tech Articles
This article describes BIND (DNS)  administration and is intended for  UNIX Systems Administrators. Go to these tutorials on DNS Queries   or DNS settings for more introductory information.