MOCs
- Network Setup
- Step 1 Install BIND
- Step 2 Configure the DNS Zone for team1.net
- Step 3 Reverse Zone File Configuration
- Step 4 Check Configuration and Restart BIND
- Step 5 Test DNS Server
- Final Config Output
- Config “/etc/bind/named.conf.local”
- Config “/etc/bind/zones/db.team1.net”
- Config “/etc/bind/zones/db.192.168.1”
Using bind on ubuntu:
Network Setup:
Step 1: Install BIND
First, update your package lists and install BIND9:
Step 2: Configure the DNS Zone for team1.net
Need to configure the forward and reverse DNS zones for team1.net
.
Forward Zone File Configuration
Navigate to the BIND directory
Create the forward zone file for team1.net
. First, open the named configuration file to define the zone:
Add the following zone definition:
Create the directory for your zones if it doesn’t already exist:
Next, create and edit the zone file:
Add the following records to the zone file:
$TTL 604800
@ IN SOA ns1.team1.net. admin.team1.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.1.12
www IN A 192.168.1.5
db IN A 192.168.1.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
:
Add the reverse zone configuration:
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.192.168.1";
};
Create the reverse zone file:
Add reverse mappings:
$TTL 604800
@ IN SOA team1.net. admin.team1.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
@ IN NS ns1.team1.net.
12 IN PTR ns1.team1.net.
5 IN PTR www.team1.net.
7 IN PTR db.team1.net.
Step 4: Check Configuration and Restart BIND
After setting up your zone files, check the configuration for errors:
If everything is configured correctly, restart BIND to apply changes:
Step 5: Test DNS Server
Use dig
or nslookup
to test your DNS server and ensure it’s resolving domain names correctly: