In order to administer DNS server (bind) from a command line, the RNDC utility needs to be correctly configured to avoid error message such as "rndc connect failed 127.0.0.1 connection refused". The objective is to configure RNDC for Bind DNS server on CentOS 7 Linux.
Operating System and Software Versions
Operating System: - CentOS Linux release 7.4.1708 (Core) Linux
Software: - Bind 9
Privileged access to your Ubuntu System as root or via sudo command is required.
# - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user
Generate RNDC Configuration
Start by execution of the rndc-confgen command to generate appropriate configuration settings:
SUBSCRIBE TO NEWSLETTER Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.
Execute the rndc-confgenlinux command to generate rndc-key and appropriate configuration stanzas for Bind and RNDC services.
Insert the previously generated RNDC configuration stanza into the file /etc/rndc.key. Your code will be different: