{"id":10857,"date":"2021-11-07T10:40:55","date_gmt":"2021-11-07T07:40:55","guid":{"rendered":"https:\/\/kifarunix.com\/?p=10857"},"modified":"2024-03-18T08:14:31","modified_gmt":"2024-03-18T05:14:31","slug":"configure-bind-dns-server-using-webmin-on-debian-11","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/configure-bind-dns-server-using-webmin-on-debian-11\/","title":{"rendered":"Configure BIND DNS Server using Webmin on Debian 11"},"content":{"rendered":"\n
Welcome to out tutorial on how to configure Bind DNS server using Webmin on Debian 11. Webmin<\/a> is a web-based control panel that allows system administrators to administer system administration tasks from web user interface.<\/p>\n\n\n\n You can follow the link below to install Webmin on Debian 11.<\/p>\n\n\n\n Install Webmin on Debian 11<\/a><\/p>\n\n\n\n All the installations and configurations will be run as root in this guide. Therefore, login as a root user or a user with sudo rights.<\/p>\n\n\n\n Launch the terminal by pressing Alt+k<\/strong>. Next, run system package update command.<\/p>\n\n\n\n Close the terminal once the update is done.<\/p>\n\n\n\n Install Bind DNS server module by navigating to Dashboard > Un-used Modules <\/strong>> BIND DNS Server > Install Now<\/strong>. This will start to build Bind package and required dependencies for installation.<\/p>\n\n\n\n Once successfully build, click Install Now<\/strong> to install the Bind packages and all required dependencies.<\/p>\n\n\n\n Once the installation is complete, click Return to BIND DNS Server<\/strong> below the screen to go back to BIND DNS Server configuration interface.<\/p>\n\n\n\n To begin with, create an access control list for your DNS server.<\/p>\n\n\n\n ACLs allows you to specify the IP addresses or networks to deny or allow to query the DNS server.<\/p>\n\n\n\n To create the ACL:<\/p>\n\n\n\n For example, we created an ACL called Click Save<\/strong> and Return to zone list.<\/strong><\/p>\n\n\n\n Next, you need to configure BIND global configuration options.<\/p>\n\n\n\n The These configurations can be made on the From BIND DNS Server<\/strong> interface:<\/p>\n\n\n\n Click Save and close to return to zone list.<\/p>\n\n\n\n Some of the configuration options used above are;<\/p>\n\n\n\n Next, you need to validate the configuration options made in the file above by clicking on Check BIND Config<\/strong> under the Bind DNS server global server options.<\/p>\n\n\n\n If there is no syntax error with the configuration file, you will see such a message as:<\/p>\n\n\n\n No errors were found in the BIND configuration file \/etc\/bind\/named.conf or referenced zone files<\/strong>.<\/p>\n\n\n\n Click Return to zone list<\/strong>.<\/p>\n\n\n\n Next, you need to create the master forward and reverse zone statements.<\/p>\n\n\n\n Click Create master zone<\/strong> on the BIND DNS server interface.<\/p>\n\n\n\n This will open up a wizard where you can define the zone statement details.<\/p>\n\n\n\n To begin with;<\/p>\n\n\n\n Next, create reverse zone statement by > Create master zone<\/strong>. This time round, select Reverse: Addresses to Names<\/strong>.<\/p>\n\n\n\n Note how the IP address is set.<\/p>\n\n\n\n Click Create<\/strong> to create the master reverse zone statement.<\/p>\n\n\n\n Next, click Return to Zone list<\/strong>.<\/p>\n\n\n\n If you have other Networks, ensure you create the reverse records for those networks. In this example, we have other networks, 192.168.60.0\/24, 192.168.59.0\/24.<\/p>\n\n\n\n Under existing DNS Zones, click your master forward zone, see example highlighted.<\/p>\n\n\n\n Click Addresses<\/strong>.<\/p>\n\n\n\n To begin with, set the A record for your DNS server.<\/p>\n\n\n\n Click Create<\/strong> to set the DNS server address A record.<\/p>\n\n\n\n Next, you can add more addresses for other hosts.<\/p>\n\n\n\n Once done, click Return to records type<\/strong>.<\/p>\n\n\n\n Click Name Server<\/strong> on Master zone configuration page.<\/p>\n\n\n\n If the name server record is not already set:<\/p>\n\n\n\n Click Create<\/strong> to add the name server records. Once done, click Return to zone list<\/strong><\/p>\n\n\n\n You should now have master zones set (forward and reverse zones) with each having defined A records and PTR records respectively.<\/p>\n\n\n\n To check the validity of the zone configuration, click on Check BIND config<\/strong>.<\/p>\n\n\n\n Click on the refresh button to apply the configurations.<\/p>\n\n\n\n Next, restart BIND on the web interface, stop and start it by clicking the stop and play buttons on the top right corner of the interface. See the highlighted section in the screenshot below.<\/p>\n\n\n\n If UFW is running, simply open the terminal (Alt+k)<\/strong> and run the command below to allow BIND.<\/p>\n\n\n\n To check if our DNS is working;<\/p>\n\n\n\n Try to resolve the DNS server hostnames using dig command.<\/p>\n\n\n\n Perform Reverse Lookup (PTR Records)<\/p>\n\n\n\n using nslookup command;<\/p>\n\n\n\n Using host command;<\/p>\n\n\n\n Reverse Lookup of DNS Server hostname.<\/p>\n\n\n\n Well, there you go. You have learnt how to Setup Bind DNS Using Webmin on Debian 11.<\/p>\n\n\n\n Install and Setup BIND DNS server on Rocky Linux 8<\/a><\/p>\n\n\n\n Setup Caching-Only DNS Server using BIND9 on Ubuntu 20.04<\/a><\/p>\n\n\n\nConfiguring BIND DNS Server using Webmin on Debian<\/h2>\n\n\n\n
Login to Webmin as Administrative User<\/h3>\n\n\n\n
<\/figure>\n\n\n\n
Run System Update<\/h3>\n\n\n\n
apt update -y<\/code><\/pre>\n\n\n\n
Install Bind DNS Server Module on Debian 11<\/h3>\n\n\n\n
<\/figure>\n\n\n\n
Configuring BIND DNS Server Using Webmin<\/h3>\n\n\n\n
<\/figure>\n\n\n\n
Configure Access Control List<\/h4>\n\n\n\n
\n
<\/figure>\n\n\n\n
allowed<\/code> to define the networks (
192.168.[57-60].0\/24<\/code>) of the hosts allowed to query our DNS server. <\/p>\n\n\n\n
Define global server configuration options<\/h4>\n\n\n\n
options<\/code> statement is used to set up global options to be used by BIND such as:<\/p>\n\n\n\n
\n
named<\/code> working directory<\/li>\n\n\n\n
\/etc\/bind\/named.conf.options<\/code> configuration file.<\/p>\n\n\n\n
\n
\/etc\/bind\/named.conf<\/code> configuration file selected.<\/li>\n\n\n\n
\/etc\/bind\/named.conf.options<\/code> configuration file.<\/li>\n\n\n\n
options {\n\tdirectory \"\/var\/cache\/bind\";\n \n recursion yes;\n allow-recursion { localhost; allowed; };\n listen-on port 53 { localhost; 192.168.58.22; };\n allow-query { localhost; allowed; };\n allow-transfer { none; };\n\n\tforwarders {\n \t\t192.168.58.1;\n 8.8.8.8;\n };\n\n\tdnssec-validation auto;\n auth-nxdomain no;\n\tlisten-on-v6 { none; };\n};\n<\/code><\/pre>\n\n\n\n
\n
<\/figure>\n\n\n\n
\n
IPv4<\/code> network interface on which to listen for queries.<\/li>\n\n\n\n
yes<\/code>.<\/li>\n\n\n\n
IPv6<\/code> network interface on which to listen for queries.<\/li>\n<\/ul>\n\n\n\n
Validate the Configuration Options<\/h3>\n\n\n\n
Create BIND DNS Server Master Zone Statements<\/h4>\n\n\n\n
<\/figure>\n\n\n\n
\n
<\/figure>\n\n\n\n
\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Setup the DNS A Records<\/h4>\n\n\n\n
<\/figure>\n\n\n\n
\n
<\/figure>\n\n\n\n
Create Name Server (NS) Records<\/h4>\n\n\n\n
\n
<\/figure>\n\n\n\n
Verify Zone Configuration Syntax<\/h4>\n\n\n\n
Running BIND<\/h4>\n\n\n\n
<\/figure>\n\n\n\n
ufw allow Bind9<\/code><\/pre>\n\n\n\n
Verify if BIND is Working<\/h3>\n\n\n\n
dig ns1.kifarunix-demo.com @192.168.58.22<\/code><\/pre>\n\n\n\n
\n; <<>> DiG 9.16.1-Ubuntu <<>> ns1.kifarunix-demo.com @192.168.58.22\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 715\n;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 1232\n; COOKIE: 4d8110c8fc7ed2cd01000000618774210bd99733b3045675 (good)\n;; QUESTION SECTION:\n;ns1.kifarunix-demo.com.\t\tIN\tA\n\n;; ANSWER SECTION:\nns1.kifarunix-demo.com.\t38400\tIN\tA\t192.168.58.22\n\n;; Query time: 0 msec\n;; SERVER: 192.168.58.22#53(192.168.58.22)\n;; WHEN: Sun Nov 07 09:37:22 EAT 2021\n;; MSG SIZE rcvd: 95\n\n<\/code><\/pre>\n\n\n\n
dig ns1.kifarunix-demo.com @192.168.58.22 +short<\/code><\/pre>\n\n\n\n
192.168.58.22<\/code><\/pre>\n\n\n\n
dig -x 192.168.58.22 @192.168.58.22<\/code><\/pre>\n\n\n\n
\n; <<>> DiG 9.16.1-Ubuntu <<>> -x 192.168.58.22 @192.168.58.22\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46718\n;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 1232\n; COOKIE: c6927d40a2a20bb001000000618774c74e25a3ed4b260fbe (good)\n;; QUESTION SECTION:\n;22.58.168.192.in-addr.arpa.\tIN\tPTR\n\n;; ANSWER SECTION:\n22.58.168.192.in-addr.arpa. 38400 IN\tPTR\tns1.kifarunix-demo.com.\n\n;; Query time: 0 msec\n;; SERVER: 192.168.58.22#53(192.168.58.22)\n;; WHEN: Sun Nov 07 09:40:08 EAT 2021\n;; MSG SIZE rcvd: 119\n<\/code><\/pre>\n\n\n\n
nslookup debian11.kifarunix-demo.com 192.168.58.22<\/code><\/pre>\n\n\n\n
Server:\t\t192.168.58.22\nAddress:\t192.168.58.22#53\n\nName:\tdebian11.kifarunix-demo.com\nAddress: 192.168.59.14<\/strong><\/code><\/pre>\n\n\n\n
nslookup 192.168.59.14 192.168.58.22<\/code><\/pre>\n\n\n\n
14.59.168.192.in-addr.arpa\tname = debian11.kifarunix-demo.com.<\/code><\/pre>\n\n\n\n
host gitlab.kifarunix-demo.com 192.168.58.22<\/code><\/pre>\n\n\n\n
Using domain server:\nName: 192.168.58.22\nAddress: 192.168.58.22#53\nAliases: \n\ngitlab.kifarunix-demo.com has address 192.168.60.11<\/code><\/pre>\n\n\n\n
host 192.168.60.11 192.168.58.22<\/code><\/pre>\n\n\n\n
Using domain server:\nName: 192.168.58.22\nAddress: 192.168.58.22#53\nAliases: \n\n11.60.168.192.in-addr.arpa domain name pointer gitlab.kifarunix-demo.com.<\/code><\/pre>\n\n\n\n
Related Tutorials<\/h3>\n\n\n\n