Configuring BIND DNS Server for Internal Network
In this tutorial, you will learn how to configure the BIND DNS (Domain Name System) server on an Ubuntu server to provide name and address resolution services for clients within an internal network.
Step 1: Install BIND
Begin by installing the BIND software on your Ubuntu server. Open a terminal and execute the following command:
sudo apt install bind9 bind9utils
Step 2: Configure BIND for Internal Network
Edit the BIND configuration files to set up the DNS server for your internal network. Replace the network and domain name placeholders in the following examples with your specific environment details.
Open the named configuration file for editing:
sudo nano /etc/bind/named.conf
Add the following line to include a new configuration file:
include "/etc/bind/named.conf.internal-zones";
Open the named options configuration file for editing:
sudo nano /etc/bind/named.conf.options
Add the following lines to set ACL entry for your internal network and adjust the allow-query and allow-transfer settings:
acl internal-network {
10.0.0.0/24;
};
options {
directory "/var/cache/bind";
# ...
allow-query { localhost; internal-network; };
allow-transfer { localhost; };
recursion yes;
# ...
};
Create a new configuration file to define your internal zones:
sudo nano /etc/bind/named.conf.internal-zones
Add the following zone definitions, replacing with your own network and domain information:
zone "srv.example" IN {
type master;
file "/etc/bind/srv.example.lan";
allow-update { none; };
};
zone "0.0.10.in-addr.arpa" IN {
type master;
file "/etc/bind/0.0.10.db";
allow-update { none; };
};
Step 3: Configure Zone Files
Create zone files for the defined zones in the previous step. Replace the placeholders with your specific network and domain details.
Create srv.example.lan Zone File
sudo nano /etc/bind/srv.example.lan
Add the following content, modifying as needed:
$TTL 86400
@ IN SOA dlp.srv.example. root.srv.example. (
2020050301 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS dlp.srv.example.
IN A 10.0.0.30
IN MX 10 dlp.srv.example.
dlp IN A 10.0.0.30
www IN A 10.0.0.31
Create 0.0.10.db Zone File
sudo nano /etc/bind/0.0.10.db
Add the following content, modifying as needed:
$TTL 86400
@ IN SOA dlp.srv.example. root.srv.example. (
2020050301 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS dlp.srv.example.
30 IN PTR dlp.srv.example.
31 IN PTR www.srv.example.
Conclusion: You have successfully configured the BIND DNS server for your internal network. The DNS server will now provide name and address resolution services for the specified domain and network.
Please make sure to replace placeholders with your own network and domain information while following the tutorial.