1. Home
  2. cPanel
  3. How to create a subdomain in cPanel, if you are using Cloudflare?

How to create a subdomain in cPanel, if you are using Cloudflare?

What is SubDomain?

A subdomain is a subset of a larger domain. It allows you to create separate sections or divisions within your main website. Subdomains are created by adding a prefix to your main domain name and separating it with a dot (e.g., subdomain.example.com).

Subdomains are useful for various reasons:

  1. Organizational Structure: Subdomains can be used to organize different sections or departments of a website. For example, a company may have a subdomain for its blog (blog.example.com) or its online store (store.example.com).
  2. Content Management: Subdomains can be used to host different types of content. For instance, you can have a subdomain for images (images.example.com) or videos (videos.example.com).
  3. Multilingual Websites: Subdomains can be employed to create versions of your website in different languages. For instance, you can have a subdomain for the English version (en.example.com) and another for the Spanish version (es.example.com).

To create a subdomain in cPanel when using Cloudflare, you can follow these steps:

  1. Log in to your cPanel account.
  2. Scroll down to the “Domains” section and click on “domains.”
  3. In the “Domains” section, you need to click on “Create a New Domain” button and enter the name of the subdomain you want to create in the “Domain” field (“sub.domain.com”).
  4. In the “Document Root” field, cPanel will automatically fill in the location where the files for your subdomain will be stored in public_html. You can uncheck it if necessary.
  5. Click “Submit” to create your subdomain.

Once the subdomain is created in cPanel, you need to configure it in Cloudflare to ensure proper DNS resolution.

Follow these steps to set up the subdomain in Cloudflare:

  1. Log in to your Cloudflare account.
  2. Select the domain associated with the subdomain from the list of websites.
  3. Navigate to the “DNS” section.
  4. Click on the “Add Record” button to create a new DNS record.
  5. Choose the record type, which is typically “A” for a subdomain.
  6. In the “Name” field, enter the desired subdomain prefix (e.g., “blog”).
  7. In the “IPv4 Address” field, enter the IP address of your hosting server.
  8. Click on the “Save” button to save the DNS record.

After completing these steps, your subdomain should be successfully created and configured in both cPanel and Cloudflare. It may take some time for the DNS changes to propagate across the internet. Once propagated, you can access your subdomain by entering its URL in a web browser.

Was this article helpful?

Related Articles

Scroll to Top