Install and Configure DNS Server on Debian 8
Definition and Functions of the Domain Name System (DNS)
Domain Name System (DNS) is a naming system for a computer with a domain name, either connected to the internet or only in a local network (LAN).
Without DNS, to access a computer, service or resource we have to access it using an IP address, which is a bit difficult to remember. Domain Name System (DNS) functions to map an IP address (IP Address) into a naming system or domain, and vice versa.
Like when accessing a website, for example; www.example.com. Actually www.example.com is the domain name of a server that has an IP Address of 10.10.10.1. With the naming system (Domain Name System), it makes it easier for users to remember the name of a computer to access it, or to access services and resources.
The Domain Name System also allows a computer to have more than one Domain name. For example, for example; www.address.com domain is a domain for a web server service or a website. While the computer has another service, namely a mail server. So DNS allows the mail server service to have its own domain name, for example www.mailaddress.com, or mail.address.com.
In the example above, “mail.address.com” is called a sub domain.
Setting IP Address on Linux/Debian
IP Address is the main requirement for a device or computer to be able to connect with other devices. Before starting to install and configure the Domain Name System (DNS) on Debian, we must first set the IP Address or Network Interfaces on the computer.
However, the IP Address does not mean anything without a Network Interface Card, or what is usually called a Network Card or LAN Card. For that, make sure your computer has a Network Interface Card. If you are using a virtual machine such as VirtualBox or VMWare Workstation, don’t forget to add a virtual Network Interface Card to the machine.
To set the IP Address in Linux/Debian, open the Interfaces file in the /etc/network/ directory. Type the following command to open the file:
# nano /etc/network/interfaces
After the file opens, add or replace the existing configuration under the words “# The Primary Network Interface” in the file as follows. IP Address can be changed as desired or needed.
...
# The Primary Network Interface
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
nameserver 192.168.1.1
When finished, save the configuration by pressing the CTRL + O key combination on the keyboard, then press CTRL + X to exit the Nano editor or the file.
For the record, on Debian with versions above 8, the name network interface by default not in “eth .” formatxlike the example above. To convert it to the format “ethx” You can use the tutorial on how to change the network interface on Debian in the format “ethx” this.
Since Network Interfaces have just been configured, the machine needs to restart the networking service for the newly configured IP address to work. Type the following command to restart the networking service:
# /etc/init.d/networking restart
Then you can check whether the Network Interfaces configuration is running or not by typing the “ifconfig” command.
# ifconfig
Then the IP Address settings will appear on the computer, check whether it matches what you have configured.
At this point the IP Address configuration is complete. Or if you want to know more about IP Address configuration, please read the article on how to configure IP Address with command line on Linux/Debian.
Installing Bind9 as DNS application on Debian 8
Bind9 (Barkeley Internet Name Domain version 9) is the best known and most commonly used DNS Server package today.
To install Bind9 or other packages on Debian can be done in several ways, such as using a CD, DVD, Flashdisk, or through the repository.
To make it easier in practice, we use DVD installation media, .iso files for DVDs can be obtained or downloaded on the official Debian website. All the required applications are already available on these DVDs which are available in several binaries.
The Bind9 package is located in the Binary-1 DVD. Insert DVD Binary-1 and type the following command to install Bind9.
# apt-get install bind9
Then press enter and wait for the bind9 installation process to complete.
Next : Configuring Domain Name System (DNS) on Debian 8 >>