Deploying Bind9 DNS: Difference between revisions

From The Opensource Knowledgebase
Jump to navigation Jump to search
First draft of installing bind9
 
mNo edit summary
Line 5: Line 5:
<pre>
<pre>
Details
Details
Platform: Ubuntu 20.04 LTS
Platform: Ubuntu 24.04 LTS
Domain: corp.zeta.tech
Domain: corp.networked.com
Realm: CORP
Realm: CORP
DNS: Forward only DNS
 
Server Locations
Server Details
-Bengaluru:
OS: Ubuntu Server
  - Diamond District: Microsoft DNS
IP address: 172.16.141.101
      - 172.16.64.51
Subnet: 255.255.255.0
      - 172.16.64.52
Gateway: 172.16.141.1
  - AMR Tech Park: Bind 9
DNS:8.8.8.8
      - 172.25.20.28
Search Domain: Corp.networked.com
  - Harman Office:
-Mumbai:
  - Plex: Microsoft DNS
      - 172.16.64.51
      - 172.16.64.52
-Hyderabad:
  - My Home Twitza: Bind 9
      - 172.25.65.22
      - 172.25.65.23
-------------------------
User Details
admin user: itadmin
Pwd: qwedsa@123
-------
admin user: itadmin
password: qwedsa@123
</pre>
</pre>
|}
|}
=Pre-requisites=
=Pre-requisites=
The default DNS for the Zeta domain - corp.zeta.tech is the built-in DNS that Samba provides while provisioning the domain controller. There are limitations with respect to the built-in DNS as it does not provide for configuring forward zones and reverse zones for resources not part of Active Directory. Hence forward only DNS server is setup using bind9. Along with '''bind9, webmin will also''' be installed to configure, maintain and manage the DNS services through an easy-to-use browser interface. Following are the pre-requisites


* Ubuntu server 20.04 LTS, fully patched
* Ubuntu server 20.04 LTS, fully patched
Line 41: Line 24:
* Internet Access
* Internet Access


=Bind 9 and webmin installation=
=Installing Bind 9 =
==Install bind9==
* For installing bind9: ssh into the dns server using the credentials and run the following commands
* For installing bind9: ssh into the dns server using the credentials and run the following commands
<pre>
<pre>

Revision as of 13:57, 24 October 2024

Setup Details
Details
Platform: Ubuntu 24.04 LTS
Domain: corp.networked.com
Realm: CORP

Server Details
OS: Ubuntu Server
IP address: 172.16.141.101
Subnet: 255.255.255.0
Gateway: 172.16.141.1
DNS:8.8.8.8
Search Domain: Corp.networked.com

Pre-requisites

  • Ubuntu server 20.04 LTS, fully patched
  • User account with sudo access
  • Internet Access

Installing Bind 9

  • For installing bind9: ssh into the dns server using the credentials and run the following commands
$ sudo apt update && sudo apt upgrade -y
$ sudo bind9 bind9utils bind9-doc dnsutils
  • Check if the service started
$ sudo systemctl status bind9.service
  • After installing the bind9 server, there are three main files that need to be modified
    • /etc/bind/named.conf.options
    • /etc/bind/named.conf.local
    • /etc/resolv.conf
  • Make changes to /etc/bind/named.conf.options. Make a copy of the original file by renaming the original file as something else as a backup in case there are any issues with the configurations
$ sudo cp -prav /etc/bind/named.conf.options /etc/bind/named.conf.options_ORG
  • Open /etc/bind/named.conf.options in an editor and make following changes
directory "/var/cache/bind";
recursion yes;
allow-query { any; };
forwarders {
8.8.8.8;
8.8.4.4;
};
forward only;
  • Save the file and restart the bind9 service
$ sudo systemctl restart bind9.service
  • Make changes to /etc/bind/named.conf.local. Make a copy of the original file by renaming the original file as something else as a backup in case there are any issues with the configurations
$ sudo cp -prav /etc/bind/named.conf.local /etc/bind/named.conf.local_ORG
  • Open the /etc/bind/named.conf.local in an editor and add the following details
zone "internal.zeta.in" {
type forward;
forward first;
forwarders { 172.16.64.51; 172.16.64.52; };
};

zone "internal.directi.com" {
type forward;
forward first;
forwarders { 172.16.140.34; 172.16.140.33; };
};

zone "corp.zeta.tech" {
type forward;
forward first;
forwarders { 172.16.64.58; 172.16.64.59; };
};

zone "ciat.supporthub.tech" {
type forward;
forward first;
forwarders { 172.16.64.58; 172.16.64.59; };
};

zone "kavp.zeta.in" {
type forward;
forward first;
forwarders { 172.16.64.51; 172.16.64.52; };
};

zone "h-nova.internal.nova.tech" {
type forward;
forward first;
forwarders { 172.16.64.51; 172.16.64.52; };
};

zone "connect.zeta.tech" {
type forward;
forward first;
forwarders { 172.16.64.58; 172.16.64.59; };
};
  • Save the above file and make change to /etc/resolv.conf by opening the file in an editor
search <domainname>
nameserver <serverip>
  • Save the file and do a configuration test and restart the bind9 server
$ sudo named-checkconf /etc/bind/named.conf.local
$ sudo systemctl restart bind9

Bind 9 server is now installed and configured.

Webmin Installation

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. Latest webmin will be installed by using the webmin repositories

Adding repository

Make a copy of the original sources.list file and then add the webmin repository -

$ sudo cp -prav /etc/apt/sources.list /etc/apt/sources.list_ORG

Add the webmin repository by opening /etc/apt/sources.list file in an editor and adding the below line at the end of the file

deb http://download.webmin.com/download/repository sarge contrib

Update and add the signing key

$ sudo apt update
$ sudo wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add

Install webmin

$ sudo apt install webmin

Start using Webmin

  • By default webmin gets installed listening to port 10000
  • Open a browser and browse https://<ip-address>:10000

Webmin is now installed

DNS Servers in other locations

  • There is no diference in the configuration files of the DNS server in other locations. Whenever a new DNS server needs to set up, copy named.conf and named.conf.local files to the new server in the same location and make changes to the /etc/resolv.conf file
  • The DNS server in the new location will be ready

References