Note:

Migrate your DNS management from Cloudflare to Oracle Cloud Infrastructure

Introduction

DNS (Domain Name System) is a crucial component of the internet that enables users to access websites by translating human-readable domain names into IP addresses that computers can understand. DNS records are stored in zones, and each zone contains information about a specific domain. Managing DNS records can be a complex task, especially if you have multiple domains and subdomains.

With Oracle Cloud Infrastructure (OCI) DNS service, you can create zones, add records to zones, and allow Oracle Cloud Infrastructure’s edge network to handle your domain’s DNS queries. By configuring Oracle DNS, enterprise and business customers can connect their DNS queries to assets such as Oracle Cloud Infrastructure Compute and Storage, as well as to third-party and private assets. Customers can also manage DNS records, which are domain names mapped to IP addresses; domain names can be cloud or non cloud resources.

Objective

Importing DNS zones from Cloudflare to OCI can help you consolidate your DNS management, and take advantage of OCI’s DNS features. The process involves exporting your DNS zone from Cloudflare and importing the DNS records. By following the steps outlined in this tutorial, you can easily import your DNS zones from Cloudflare to OCI and streamline your DNS management.

Prerequisites

Task 1: Export your DNS zone from Cloudflare

  1. Log in to your Cloudflare account and select the domain for which you want to export the DNS zone.

  2. Click Export to download a copy of your DNS zone file.

    Edit button

Task 2: Modify zone files exported from cloudflare.com to be imported to OCI DNS

To get the Oracle Cloud Infrastructure DNS service to correctly import a zone file exported from cloudflare.com, you must modify the file. Follow these instructions to update the zone file.

  1. Open the file in your preferred text editor. Modify the second line, remove the ;; Domain: and replace it with $ORIGIN.

    Edit button

  2. For the SOA record, replace the domain name with @.

    Edit button

  3. Once the file has been modified, save changes to the file.

Points to note for modifying the exported zone file from cloudflare.com

Task 3: Import your DNS zone into OCI DNS

  1. Log in to the OCI tenancy, navigate to Networking, DNS Management, Zones.

    Edit button

  2. Click Create Zone and then click Import. Select the modified zone file and create the zone.

    Edit button

It will take a few seconds for the zone to get created and populated with the records.

Edit button

Task 4: Verify your DNS zone in OCI DNS

  1. Verify that all the DNS records from your Cloudflare zone are present in OCI DNS. You can export the records from OCI DNS to a TXT file and compare. You can use cloud shell to export the records as shown below.

    oci dns zone get-zone-content --file $file --zone-name-or-id $zone_name_or_id

    Edit button

    • When you want to switch from the Cloudflare DNS servers to the OCI DNS servers, modify the name servers from the domain registrar to point to the OCI Name servers(NS) assigned when the zone was imported.

    • Here we are transferring the Hosted Zone for the Domain from Cloudflare to Oracle DNS, not the registration of the domain itself. The domain will still be registered with the existing registrar, whether it’s Cloudflare, GoDaddy, or any other provider.

    • The process for transferring the Hosted Zone will be the same regardless of your domain registrar, as long as you are able to update the DNS records there and migrate the domain to OCI.

    • Post modifying the name servers, you can test by performing nslookup queries from your machine or use whatsmydns.net to make sure that the domain management is migrated to OCI DNS.

      Edit button

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.