Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon Oct 18, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Install the bind and bind-utils Packages with YUM

    $ yum install bind bind-utils -y
    
  2. 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; };
    };
    
  3. Challenge

    Check the named.conf File for Syntax Errors

    named-checkconf
    
  4. 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
    
  5. 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.
    
  6. 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
    
  7. 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.
    
  8. Challenge

    Check the Forward Zone for domain2.com for Syntax Errors

    $ named-checkzone domain2.com fwd.domain2.com.db
    
  9. 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.
    
  10. Challenge

    Start the named Service

    systemctl start named
    
  11. 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
    

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans