Helpful Commands For Managing And Trouble Shooting a BIND (DNS) Server in Ubuntu Linux

 BIND is a DNS service that is used on many different distributions of Linux. BIND stands for Berkeley Internet Name Domain. When I setup my home network, I wanted to have a local DNS server. I installed BIND on my 9.04 Ubuntu server.

 

This is a list of commands that I have found helpful for trouble shooting and managing my DNS server.

 

(Note: All of the commands are being executed in a terminal window.Copy and paste the code after the # symbol into a terminal window.)  

 

How to find what version of BIND you are running:

# nslookup -q=txt -class=CHAOS version.bind. 0

 

 

 

How to Restart BIND DNS service:

# sudo service nscd restart

 

# sudo /etc/init.d/nscd restart

 

 

How to Start and Stop BIND DNS service:

If you are running BIND v.8 or less:

 

# sudo ndc stop

# sudo ndc start

 

 

If you are running BIND v.9:

# sudo rndc stop

# sudo rndc start

 

 

How to view the cache of the BIND:

For this we will create a dump file and then will need to view the file.

 

Creating the Dump file: 

# sudo rndc dumpdb –cach

 

(Note: This will create a dump file called named_dump.db. This is often located in /var/cache/bind.) 

 

Viewing the dump file:

 

# cat /var/cache/bind/named_dump.db

 

 

How to Clear the Cache of BIND:

You can just restart the service using the restart command. 

 

# sudo /etc/init.d/nscd restart 

 

ShareThis
 

If this information was useful, please consider donating a small amount to help cover bandwith costs.