First, update your package lists and install BIND9:
sudoaptupdatesudoaptinstallbind9dnsutils
Step 2: Configure the DNS Zone for team2.net
Need to configure the forward and reverse DNS zones for team2.net.
Forward Zone File Configuration
Navigate to the BIND directory
cd/etc/bind
Create the forward zone file for team2.net. First, open the named configuration file to define the zone:
sudonanonamed.conf.local
Add the following zone definition:
zone "team2.net" {
type master;
file "/etc/bind/zones/db.team2.net";
};
Create the directory for your zones if it doesn't already exist:
sudomkdir/etc/bind/zones
Next, create and edit the zone file:
sudonano/etc/bind/zones/db.team2.net
Add the following records to the zone file:
$TTL 604800
@ IN SOA ns1.team2.net. admin.team2.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
; Name servers
@ IN NS ns1.team2.net.
; A records for name server and other hosts
ns1 IN A 192.168.2.12
www IN A 192.168.2.5
db IN A 192.168.2.7
Step 3: Reverse Zone File Configuration
This step is optional but recommended for resolving IP addresses back to hostnames.
Define the reverse zone in named.conf.local:
sudonanonamed.conf.local
Add the reverse zone configuration:
zone "2.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.192.168.2";
};
Create the reverse zone file:
sudonano/etc/bind/zones/db.192.168.2
Add reverse mappings:
$TTL 604800
@ IN SOA team2.net. admin.team2.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ IN NS ns1.team2.net.
12 IN PTR ns1.team2.net.
5 IN PTR www.team2.net.
7 IN PTR db.team2.net.
Step 4: Check Configuration and Restart BIND
After setting up your zone files, check the configuration for errors: