Live Chat

Domain Scan

(empty)

Login


How to Manage Your Register.lk Domain with Cloudflare
(09-jul-2024)

Managing Register.lk Domain with Cloudflare

Managing your website's DNS can be a daunting task, but with tools like Cloudflare, it becomes much easier. This guide will walk you through creating a Cloudflare account, understanding the benefits of using Cloudflare with Register.lk, and performing essential DNS management tasks like managing subdomains, setting up MX records, and redirecting traffic. By the end of this guide, you'll have a solid understanding of how to leverage Cloudflare to enhance your website's performance and security.

Benefits of Managing Register.lk Hosting DNS Through Cloudflare

Let's explore why you might use it to manage your Register.lk DNS:
  • Improved Performance: Cloudflare's CDN caches your static content at data centers around the world, reducing latency and speeding up load times for your visitors.
  • Enhanced Security: Cloudflare offers built-in DDoS protection, firewall rules, and SSL/TLS encryption, safeguarding your site against cyber threats.
  • Easy DNS Management: Cloudflare's intuitive dashboard makes it easy to manage your DNS records, even if you're not a tech expert.
  • Free SSL Certificates: Cloudflare provides free SSL certificates, ensuring your site is secure without additional costs.
  • Analytics: Get detailed insights into your website's traffic and security events.

Creating a New Cloudflare Account

Let's start with the basics: setting up a Cloudflare account. This is a straightforward process that comes with both free and premium options. Here's how to get started:
  1. Visit Cloudflare's Website: Go to cloudflare.com and click on the "Sign Up" button.
  2. Sign Up: Enter your email address and create a password. Cloudflare offers both free and premium accounts, but for most users, the free plan is sufficient. The free plan includes essential features like DNS management, SSL/TLS encryption, DDoS protection, and basic CDN capabilities.
  3. Verify Email: You'll receive a verification email. Click the verification link to activate your account.
  4. Add Your Website: Once logged in, click "Add a Site", enter your domain, and follow the setup wizard.

Update Your Nameservers

During the setup process, Cloudflare will provide you with specific nameservers, such as "lisa.ns.cloudflare.com." You need to update your domain's nameservers to these Cloudflare nameservers.

  • If Your Domain Provider is Register.lk:
    1. Log in to your Register.lk account.
    2. Navigate to Nameservers Management:
      • Go to the Register.lk website.
      • Click "My Account."
      • Select "Domains > My Domains."
      • Click the "Active" button next to your domain.
    3. Update Nameservers: Replace your current nameservers with the ones provided by Cloudflare.

  • If Your Domain is Registered Elsewhere:
    1. Log in to your domain registrar's account.
    2. Navigate to the section for managing nameservers.
    3. Update Nameservers: Replace the existing nameservers with the Cloudflare nameservers provided during the setup.
    NOTE: When you add a new domain to Cloudflare, it typically performs an automatic scan to detect and import existing DNS records. This helps to ensure that your domain's current DNS settings are carried over, minimizing disruption and making the transition to Cloudflare smoother. However, it's important to verify the imported records for accuracy and completeness, as the scan may not always capture every record perfectly. If necessary, you can manually add or edit DNS records to match your specific requirements by following the below steps.

    Adding an A Record to the Root Domain and Pointing It to Your Hosting Package

    Now, let's add an A record to the root domain and point it to your hosting package. This is crucial for directing traffic to your website hosted on Register.lk:
    1. Log in to Cloudflare: Access your Cloudflare dashboard and select your domain.
    2. Go to DNS Settings: Click on the "DNS" tab.
    3. Add a Record: Click "Add Record".
    4. Type: Select "A" from the dropdown menu.
    5. Name: Enter "@" to represent the root domain (e.g: example.com).
    6. IP Address: Enter the IP address provided by Register.lk. Or you will be able to see the IP address of your hosting on your control panel dashboard.
    7. TTL: Choose an appropriate TTL (Time to Live) value, or leave it at the default.
    8. Proxy Status: Choose whether to enable or disable Cloudflare's proxy (orange cloud icon). Enabling the proxy provides additional benefits like CDN and security features.
    9. Save Changes: Click "Save" to apply your new A record.

    Setting Up MX Records Using Your Cloudflare

    Next, let's look at how to update MX records, which are essential for directing email to your mail server:
    1. Access DNS Settings: From your Cloudflare dashboard, navigate to the "DNS" tab.
    2. Add MX Record: Click "Add Record," select "MX" from the dropdown menu.
    3. Enter Details: Input the name (usually just your domain, e.g: example.com), priority (lower numbers have higher priority), and the mail server address (e.g: mail.example.com).
    4. Save: Click "Save" to update your DNS settings.

    Adding Other Record Types

    You can add other record types (e.g., CNAME, TXT) by following the same path:
    1. Log in to Cloudflare: Access your Cloudflare dashboard and select your domain.
    2. Go to DNS Settings: Click on the "DNS" tab.
    3. Add a Record: Click "Add Record".
    4. Type: Select the appropriate record type from the dropdown menu (CNAME, TXT, etc.).
    5. Enter Details: Fill in the necessary details for the record type you've selected.
    6. Save Changes: Click "Save" to apply your new DNS record.

    Managing Subdomains Using Cloudflare

    Okay, now let's see how to manage subdomains using Cloudflare. This process is straightforward and quick:
    1. Log in to Cloudflare: Access your Cloudflare dashboard and select your domain.
    2. Go to DNS Settings: Click on the "DNS" tab.
    3. Add a Record: Click "Add Record," choose the type (usually an "A" record), enter the subdomain name (e.g: subdomain.example.com), and point it to the appropriate IP address.
    4. Save Changes: Click "Save" to apply your new DNS record.

    Understanding the Functionality of Proxy

    Before we move on to redirection, it's important to understand the functionality of Cloudflare's proxy:
    • CDN: Caches your content at Cloudflare's global data centers, reducing latency.
    • DDoS Protection: Detects and mitigates DDoS attacks, keeping your site online.
    • SSL Encryption: Encrypts traffic between your visitors and Cloudflare, and optionally between Cloudflare and your origin server.
    • IP Masking: Hides your origin server's IP address, protecting it from direct attacks.

    Cloudflare Redirection

    Now, let's see how to set up URL redirects using Cloudflare, which is useful for managing traffic. Here's how to do it:
    1. Page Rules: Navigate to the "Page Rules" section in your Cloudflare dashboard.
    2. Create a Rule: Click "Create Page Rule" and enter the URL pattern you want to match (e.g: example.com/old-page).
    3. Set Forwarding URL: Select "Forwarding URL" and choose "301 - Permanent Redirect" or "302 - Temporary Redirect" based on your needs.
    4. Enter Destination URL: Input the destination URL (e.g: example.com/new-page) where you want the traffic to be redirected.
    5. Save and Deploy: Click "Save and Deploy" to activate the redirect.

    Setting Up HTTP to HTTPS Redirection

    Ensuring all traffic to your website is secure with HTTPS is crucial. Here's how you can set up an HTTP to HTTPS redirection using Cloudflare:
    1. Page Rules: Navigate to the "Page Rules" section in your Cloudflare dashboard.
    2. Create a Rule: Click "Create Page Rule."
    3. Enter URL Pattern: In the URL pattern field, enter http://example.com/* (replace example.com with your actual domain). The asterisk (*) ensures that all traffic, including subpages, is redirected.
    4. Set Forwarding URL: In the "Then the settings are" section, select "Forwarding URL" and choose "301 - Permanent Redirect."
    5. Enter Destination URL: In the "Destination URL" field, enter https://example.com/$1. The $1 preserves the path after the domain.
    6. Save and Deploy: Click "Save and Deploy" to activate the redirect.

    Conclusion

    In this guide, we've walked you through the essential steps of setting up a Cloudflare account, updating your nameservers, managing subdomains, configuring MX records, and setting up URL redirects. Additionally, we've explored the functionality of Cloudflare's proxy and demonstrated how to ensure all traffic to your site is secured with HTTPS redirection.

    If you need further support on your Cloudflare DNS management, do not hesitate to contact Register.lk Support Team.


    Written by: Register.lk Support Hero - Kesaru
    BACK 2 BLOG