Linux: Start / Stop / Restart DNS Server

BIND is most widely DNS server software on the internet. Following are the basic commands which can be used in Linux distro:

1. service service-name [start|stop|restart] command.

2. /etc/init.d/service-name [start|stop|restart] script command.

3. systemctl [start|stop|restart] service-name command.

4. rndc command – Name server control utility.

CentOS / RHEL / Fedora Linux using the service command

You can start/stop/restart DNS service (BIND) via SSH using following commands on CentOS / RHEL / Fedora Linux:

To start DNS service (named) via SSH:

/etc/init.d/named start

To stop DNS service (named) via SSH:

/etc/init.d/named stop

To restart DNS service (named) via SSH:

/etc/init.d/named restart

To check current status:

/etc/init.d/named status

You can also use the following commands to start / stop / restart BIND DNS service:

service named start
service named stop
service named restart

To reload BIND server to reload DNS zone or configuration file changes, use the following command:

service named reload

Use the following command to see the current status of BIND server:

service named status

Systemd users need to use the systemctl command:

systemctl stop named
systemctl start named
systemctl restart named
systemctl status named

Debian / Ubuntu Linux

Type the following command to start BIND server:

service bind9 start

Type the following command to stop BIND server:

service bind9 stop

Type the following command to restart BIND server:

service bind9 restart

To reload BIND server to reload DNS zone or configuration file changes, use the following command:

service bind9 reload

Use the following command to see the current status of BIND server:

service bind9 status

You can also use the following commands Debian / Ubuntu:

/etc/init.d/bind9 start
/etc/init.d/bind9 stop
/etc/init.d/bind9 restart
/etc/init.d/bind9 status

Systemd users need to use the systemctl command:

systemctl stop bind9
systemctl start bind9
systemctl restart bind9
systemctl status bind9

Please note, you will need root access of the server to restart DNS/named service. If you have other questions related to DNS server, you can join our community forum.

Leave a Reply