Friday, August 3, 2018

Set up Oracle Cloud Infrastructure DNS to use Domain Name

In this post we will configure Oracle Cloud Infrastructure DNS feature to Map a Domain name. This is a required step to Map the Load Balancer IP Address to a domain name so that users can access your Application/Web Servers inside the cluster with a domain name in the browser.

Below are the pre requisites for setting up Domain Name and Load Balancer Mapping in OCI.

  • Existing Domain Name. If you do not have, you can buy it from any vendor e.g. godaddy,bigrock.. etc. In this post I will use my domain :
  • Working Oracle Cloud Infrastructure Set Up - Two Web Instances in different Availability Domain with Load Balancer configured in Front.
  • For this Example, we have Two Web Servers (Backend Servers) - Webserver1 & Webserver2 in two Availability domain's as Backend Set. Load Balancer is configured to spread load to Webserver1 & Webserver2 on Port 80. Listener is configured to listen http traffic on Load Balancer IP address on Port 80.
*** All IP Addresses and Name Server  have been masked for security reasons.

Ok so we are good with the Set up. Let us configure OCI DNS Service to use Domain Name.

First, go to OCI DNS Service home page from OCI Account.

Click Create Zone.

Enter Method as Manual, Zone Name as your Domain Name and Zone Type as  Primary.

You can see below Zone added as primary Zone in your Zones List.

Now click on the Zone - and Drill down.

Click on Add Record.

Add A RECORD as below.

Add TTL time as per your requirement. Can set any for demo purpose.

You can add CNAME to resolve as below.

Now one last step on OCI DNS side is to Publish all the changes.

Click on Publish changes and confirm on the Pop Up.

We are all good on OCI DNS Side.

Now last step is to update Name Servers in Domain Hosting with Name Servers provided by OCI DNS for our Hosted Zone.

These Name Server's information is inside your Zone.

Copy all the four Name Servers and add it to your Domain Name Name Servers Settings inside your Domain Name Provider's -> Management -> Name Servers configuration.

Ok Done, We are all set.

Give some time for DNS changes to propagate.

Lets do a quick test. Open the url :

Doing a Refresh on the url will send the request to second instance in round robin fashion

We have mapped domain name to OCI Load Balancer and the request hits the OCI Load Balancer after which the LB passes the request to one of the Backend Web Servers.

No comments:

Post a Comment