How To Start / Stop / Restart / Enable / Reload The Bind (Named) DNS Service In Linux?

systemd is a new system and service manager for Linux system, which was implemented/adapted into all the major Linux distributions over the traditional SysV init systems due to lots of issue/improvement has to be on SysVinit systems.

All the service files are available on /etc/init.d/ directory for SysVinit system.

For systemd system, the service files are available on /usr/lib/systemd/system/ directory.

If you would like to perform any kind of actions like start, stop, restart, enable, reload & status against the specific service then use the following commands.

Make sure that you should have admin privileges to run these commands except status command. It should be root or sudo permission needed to run the below commands.

What Is Bind DNS Server?

BIND stands for Berkeley Internet Domain Name. BIND or named is the Domain Name System (DNS) which is widely used in Linux/Unix system to perform DNS operations.

BIND is a single system that performs both authoritative and recursive DNS functions.

The named daemon controls the operation of a Bind dns server.

1) How To Start The Bind DNS Service In Linux?

Use the below commands to start the Bind/named server in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# service named start
or
# /etc/init.d/named start

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl start named
or
# systemctl start named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl start bind9
or
# systemctl start bind9.service

2) How To Stop The Bind DNS Service In Linux?

Use the below commands to stop the Bind/named server in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# service named stop
or
# /etc/init.d/named stop

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl stop named
or
# systemctl stop named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl stop bind9
or
# systemctl stop bind9.service

3) How To Restart The Bind DNS Service In Linux?

Use the below commands to restart the Bind/named server in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# service named restart
or
# /etc/init.d/named restart

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl restart named
or
# systemctl restart named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl restart bind9
or
# systemctl restart bind9.service

4) How To Reload The Bind DNS Service In Linux?

Use the below commands to reload the Bind/named server in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# service named reload
or
# /etc/init.d/named reload

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl reload named
or
# systemctl reload named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl reload bind9
or
# systemctl reload bind9.service

5) How To View The Bind DNS Service Status In Linux?

Use the below commands to view the Bind/named server status in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# service named status
or
# /etc/init.d/named status

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl status named
or
# systemctl status named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl status bind9
or
# systemctl status bind9.service

6) How To Enable The Bind DNS Service On Boot In Linux?

Use the below commands to enable the Bind/named server on boot in Linux.

For SysVinit Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# chkconfig named on

For systemd Systems – RHEL based systems such as Redhat, CentOS and Fedora.

# systemctl enable named
or
# systemctl enable named.service

For systemd Systems – Debian based systems such as Debian and Ubuntu.

# systemctl enable bind9
or
# systemctl enable bind9.service

The default configuration file is located at /etc folder.

/etc/named.conf		- For RHEL Based systems
/etc/default/bind9  - For Debian Based systems

rndc stands for Remote Name Daemon Control. rndc controls the operation of a name server. It supersedes the ndc utility that was provided in old BIND releases.

We can use this tool to check, how many dns zones were configured in the system.

 
# rndc status
version: 9.9.4-RedHat-9.9.4-73.el7_6 
CPUs found: 2
worker threads: 2
UDP listeners per interface: 2
number of zones: 550
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

For All service commands View More

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

Leave a Reply

Your email address will not be published. Required fields are marked *