Note:

Configure BIND9 Domain Name System in Oracle Cloud Infrastructure

Introduction

OraStage is a leading company in the energy sector, specializing in renewable energy solutions and innovative power technologies, the company announced a strategic decision to migrate its workloads to Oracle Cloud Infrastructure (OCI) to enhance performance, scalability, and security.

image

Taking into account the specific needs and conditions that OraStage has outlined, the company requires a hybrid Domain Name System (DNS) solution in the cloud, and by hybrid here means to use their own Berkeley Internet Name Domain version 9 (BIND9) DNS system in addition to OCI DNS service, where the final architecture they are looking to build is shown in the following image.

image

OraStage DNS requirements:

This tutorial series will guide you step by step to achieve the outlined requirements above, building the entire solution from scratch. You can easily navigate to each tutorial from the list below:

Overview of BIND9

BIND9 (Berkeley Internet Name Domain version 9) is one of the most widely used and mature DNS (Domain Name System) server software packages in the world. It is developed and maintained by the Internet Systems Consortium (ISC). BIND9 serves as the backbone for much of the Internet’s DNS infrastructure, providing robust and reliable DNS services for both small and large-scale deployments.

BIND9 flexibility, robustness, and extensive feature set make it suitable for a wide range of DNS applications, from small internal networks to the largest public DNS services on the Internet.

Key Features of BIND9

Common Use Cases of BIND9

Installation and Configuration of BIND9

Use BIND9 on OCI

There are several reasons why some customers might choose to use and manage their own DNS (such as BIND9) instead of using Oracle Cloud Infrastructure (OCI) managed DNS services:

While OCI managed DNS services offer ease of use, scalability, and reduced management overhead, these factors highlight why some organizations might opt to manage their own DNS infrastructure.

Goals for Setting Up BIND9 in OCI

Objectives

Final architecture

image

Prerequisites

Task 1: Set up Routing and Security Network Components

Task 1.1: Create VCNs

Task 1.2: Create a Dynamic Routing Gateway (DRG)

DRG is a virtual router that provides a path for private traffic from one VCN to another, or between a VCN and an on-premises network, or even a VCN with other cloud environment networks. So, it is a powerful and critical component for every OCI network environment. In this tutorial, we are going to use it to establish connectivity between multiple VCNs in the same region.

Task 1.3: Attach VCNs to the DRG

Task 1.4: Configure Routing and Security for DNS-VCN

Task 1.5: Configure Routing and Security for Frontend-VCN

image

Task 1.6: Configure Routing and Security for Backend-VCN

Task 2: Provision an OCI Compute Instance

Provision a compute instance where BIND9 will be configured.

Task 2.1: Generate SSH Key Pair

This must be done before creating the instance. SSH keys will be used to authenticate to Linux compute instances. You can generate the keys either using PuTTYgen tool on a Windows machine, or ssh-keygen utility on any machine. In this tutorial, we are going to use ssh-keygen in OCI Cloud Shell.

image

Task 2.2: Provision Primary-DNS Compute Instance

Task 3: Install and Configure BIND9

Task 3.1: Access Primary-DNS Compute Instance using Bastion

Task 3.2: Install BIND9

After accessing the instance, we will install BIND9 and make sure it is up and running.

Task 3.3: Change the Fully Qualified Domain Name (FQDN) of the Instance

Task 3.4: Configure the named.conf.options File

Task 3. 5: Use netstat to display TCP/UDP Ports Status

net-tools is a package of command-line utilities that provide a collection of essential networking tools for Linux OS.

Task 3.6: Configure the named.conf.local File

Task 3.7: Configure the db.orastage.com File

Task 3.8: Configure the 50-cloud-init.yaml File

Task 3.9: Disable iptables Firewall

Task 3.10: Restart BIND9

Task 3.11: Test

Task 4: Configure OCI Forwarding Endpoints and Rules

Each OCI VCN has a default resolver that can be used to resolve hostnames in the same VCN, different VCNs, on-premises networks, or even publicly published hostnames on the Internet. In this task, we are going to use two components in the resolver to achieve our requirement of forwarding queries to the BIND9 instance Primary-DNS, which are:

Task 4.1: Configure Forwarding Endpoint and Rule for Frontend-VCN

Create a forwarding endpoint and rule in Frontend-VCN, to point orastage.com queries from FE-VM to the Primary-DNS instance.

Task 4.2: Configure Forwarding Endpoint and Rule for Backend-VCN

Create a forwarding endpoint and rule in Backend-VCN, to point orastage.com queries from BE-VM to the Primary-DNS instance.

image

Task 5: Provision Client Instances to Perform DNS Queries

Task 5.1: Create FE-VM Compute Instance

Task 5.2: Create BE-VM Compute Instance

Note: In the later tasks, we will test multiple scenarios and validate that the setup is working as expected.

Task 6: Test and Validate

Task 6.1: Access FE-VM Compute Instance using Bastion and Test

As shown in the above test, we can retrieve the IP address of the BE-VM domain, and the ping is working using the hostname, which means the test is successful.

Task 6.2: Access BE-VM Compute Instance using Bastion and Test

image

As shown in the above test, we can retrieve the IP address of the FE-VM domain, and the ping is working using the hostname, which means the test is successful.

Next Steps

In this tutorial, we built a small BIND9 DNS architecture with basic components; server and client setup in Oracle Cloud Infrastructure. Throughout this segment, you gained insights into OCI network routing and security, by dealing with different components such as Route Tables, DRG, Security Lists, Bastion, and more. You also learned how to install and configure a functional BIND9 DNS in an OCI environment.

In the next tutorial: Tutorial 2: Implement High Availability on BIND9 Domain Name System in Oracle Cloud Infrastructure, we will enhance this setup by incorporating the high availability layer into our architecture, which is crucial for reducing downtime and improving the user experience.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.