- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

DNS and BIND: Configuring Multiple Domains
Creating multiple domains allows users to configure separate groups of IP addresses. One use case for this scenario is grouping IPs for different environments such as prod, dev, qa, etc into different domains and zones with different zone rules. In this lab, students will learn to configure multiple domains for the same name server in the `/etc/named.conf`. We will then create the associated zone flies and test the configuration using the `nslookup` command.

Lab Info
Table of Contents
-
Challenge
Install the bind and bind-utils Packages with YUM
$ yum install bind bind-utils -y
-
Challenge
Configure Zones for localdomain.com and domain2.com in the /etc/named.conf File
vim /etc/named.conf
zone "localdomain.com" { type master; file "fwd.localdomain.com.db"; allow-update { none; }; };
zone "1.0.10.in-addr.arpa" { type master; file "1.0.10.db"; allow-update { none; }; };
zone "domain2.com" { type master; file "fwd.domain2.com.db"; allow-update { none; }; };
-
Challenge
Check the named.conf File for Syntax Errors
named-checkconf
-
Challenge
Create the Forward and Reverse Zone Files in /var/named
$ cd /var/named $ touch fwd.localdomain.com.db 1.0.10.db fwd.domain2.com.db $ ls -al $ chown named:named *.db
-
Challenge
Populate the Forward Zone File for localdomain.com with TTL, SOA, NS, and A, and CNAME Records
$ vim /var/named/fwd.localdomain.com.db $TTL 86400 @ IN SOA ns.localdomain.com. root.localdomain.com. ( 10030 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expiry 86400 ;Minimum TTL ) ; Name Server @ IN NS ns.localdomain.com. ;A Record Definitions ns IN A 10.0.1.201 ; Canonical Name/Alias dns IN CNAME ns.localdomain.com.
-
Challenge
Run the named-checkzone Command to Check the Forward Zone File for localdomain.com for Syntax Errors
$ named-checkzone localdomain.com fwd.localdomain.com.db
-
Challenge
Populate the Forward Zone File for domain2.com with the TTL, SOA, NS, A, and CNAME Records
$ vim fwd.domain2.com.db $TTL 86400 @ IN SOA ns.localdomain.com. root.localdomain.com. ( 10030 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expiry 86400 ;Minimum TTL ) ; Name Server @ IN NS ns.localdomain.com. ;A Record Definitions server1 IN A 10.0.1.220 server2 IN A 10.0.1.221 ; Canonical Name/Alias prod IN CNAME server1.domain2.com.
-
Challenge
Check the Forward Zone for domain2.com for Syntax Errors
$ named-checkzone domain2.com fwd.domain2.com.db
-
Challenge
Populate the Reverse File for Both Zones with the TTL, SOA, NS, and PTR Records
$ vim 1.0.10.db $TTL 86400 @ IN SOA ns.localdomain.com. root.localdomain.com. ( 10030 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expiry 86400 ;Minimum TTL ) ; Name Server @ IN NS ns.localdomain.com. ;PTR Records 201 IN PTR ns.localdomain.com. 220 IN PTR server1.domain2.com. 221 IN PTR server2.domain2.com.
-
Challenge
Start the named Service
systemctl start named
-
Challenge
Use the nslookup Command to Verify the Records That Were Configured Resolve
$ nslookup ns.localdomain.com localhost $ nslookup server1.domain2.com localhost $ nslookup server2.domain2.com localhost $ nslookup 10.0.1.220 localhost
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.