Advance

Setup private DNS Server in Debian 10

Set up private DNS Server in Debian 10

Learn how to Setup private DNS Server in Debian 10 Linux step by step. Bind is a DNS service that assigns a unique name to your ip address, which is actually called a domain name. This makes it easier to resolve the ip address on the Internet or even on a local area network (LAN). A network can have only one domain name. When the domain name is resolved to its ip address, this operation is identified as the forward zone, and when a ip address is referenced to its name, it is known as the revers zone. In this article, we try to teach you how to set up a private DNS Server in Debian 10. You can visit various packages in Eldernode to buy VPS server.

Setup private DNS Server in Debian 10

Bind stands for The Berkeley Internet Name Domain is known as a DNS service in Linux. Bind is one of the most popular domain name services that we will install in this article. In this tutorial, we will first install Bind and then in the second step, we will build a Zone in the internal network. Stay with us.

Recommended Article: Tutorial Setup Sudo Privileges For User In Ubuntu 20.10

Tutorial Setup private DNS Server in Debian 10

How to install and adjust Bind in Debian 10 Linux

1. First, set up your Debian 10 host.

Note that the hostname must be FQDN and the domain name must be the domain you want to use. For example, the domain in question is eldernode.local, and we call the server Srv.eldernode.com.

2. Then enter the following command to equip your Debian with the latest updates:

apt update

3. After the full update, reboot the system once.

reboot

How to install Bind in Debian Stretch

1. Enter the following command to install the Bind service and package:

apt -y install bind9 bind9utils dnsutils

2. After installation, start the bind service with the following command:

systemctl start bind9

Learn how to set Bind in Debian 10 and build Zone

1. Open the etc/bind/named.conf file with an editor:

vi /etc/bind/named.conf

Enter the following statements to set up Bind storage files and how they work:

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
# add
include "/etc/bind/named.conf.internal-zones";

So far, you are familiar with installing and setting Bind. Now we will build a Zone for the internal network.

2. Open the etc/bind.named.conf.internal-zones file with the editor.

This file is the same file that was added in the Bind setting. If you have changed its name, you must add the same name in this section:

vi /etc/bind/named.conf.internal-zones

3. Then copy and paste the following statements to create and set up a Zone:

# create new  # define for internal section  view "internal" {          match-clients {                  localhost;                  10.0.0.0/24;          };          # set zone for internal          zone "eldernode.local" {                  type master;                  file "/etc/bind/srv.eldernode.local";                  allow-update { none; };          };          # set zone for internal *note          zone "0.0.10.in-addr.arpa" {                  type master;                  file "/etc/bind/0.0.10.db";                  allow-update { none; };          };          include "/etc/bind/named.conf.default-zones";  };

Note: In the above statements, note that in the fields that turn red, you must enter your domain name, IP range and reverse Zone name.

How to determine the Bind Response Range (private DNS Server in Debian 10)

Now if you need to set the Bind server response range, you should do the following.

1. Open the etc/ bind/named.conf.options/ file with an editor.

vi /etc/bind/named.conf.options

2. Then enter the following commands to restrict Bind to respond to a specific IP range:

options {            directory "/var/cache/bind";           # query range you allow          allow-query { localhost; 10.0.0.0/24; };          # the range to transfer zone files          allow-transfer { localhost; 10.0.0.0/24; };          # recursion range you allow          allow-recursion { localhost; 10.0.0.0/24; };            dnssec-validation auto;            auth-nxdomain no;    # conform to RFC1035          # change if not use IPV6          listen-on-v6 { none; };  };

Here the installation and adjustment of Bind and construction of Zone in the internal network is completed.

After adding or editing each Zone and the files mentioned with the following command, you must restart the Bind service once:

systemctl restart bind9

Note: The DNS service will serve with port 53 and the TCP and UDP protocols, so open this port for both protocols in your system firewall.

Conclusion

Perhaps the main purpose of DNS is to facilitate network requests. It is always very easy to remember the name and this is the reason why we assign a name to the ip address on each network. In this article, we tried to teach you how to set up a private DNS Server in Debian 10. If you are also interested in Ubuntu distribution, you can refer to the article How to Setup private DNS server on ubuntu 20.04.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day