Guides and tutorials

Hundreds of tutorials and step by step guides carefully written by our support team.

How to manage your subdomain with SWPanel and Cloudflare

How do nameservers work at the subdomain level?

Any domain and all its subdomains always share the same nameservers unless a zone delegation is made for the subdomains.

For example, if our domain "swmanuales.com" has the nameservers "dns3.swhosting.com" and "dns4.swhosting.com" assigned to it, all subdomains such as "subdomain.swmanuales.com" will have the same nameservers assigned to them by default.

What is a zone delegation?

A zone delegation consists in the creation of NS records in the DNS zone of the main domain, which allow to delegate to specific Nameservers the DNS resolution of the subdomain records.

Why do I need to perform a zone delegation for my subdomain if my main domain goes through Cloudflare?

When you activate the Cloudflare CDN service for your main domain, the nameservers that were originally available in your dns zone will be removed to avoid conflicts with those that will be applied at the domain level. When this action is carried out, the nameservers assigned to the subdomain will be inoperative, as Cloudflare does not have a specific dns zone for subdomains.

For this reason, we will have to go to the dns zone of the main domain and create the nameservers to delegate the zone to our subdomain.

How can I perform the zone delegation of my subdomain?

First of all you will need to know the original nameservers to which your subdomain points.

1. Go to your SWPanel, enter the name of your subdomain, and select it.

.

2. Once in the service dashboard, select "Service management " -> "DNS management " in the side menu.

.

3. Once in the DNS zone of the subdomain, you can see which nameservers are assigned to your service. In the case of our example with the subdomain "subdomain.swmanuales.com" the nameservers are: "dns3.swhosting.com" and "dns4.swhosting.com".

.

Now that we know the nameservers that must be used in the delegation, we must go to the dns zone of the main domain, "swmanuales.com" and create the corresponding ns records.

1. Go to your SWPanel, enter your domain name, and select it.

.

2. Once in the service dashboard, select "Service management " -> "DNS management " in the side menu.

.

3. Click on the button "Create Record".

.

4. In the next section select:

  • In "DNS Zone Details" - Registry Type: select the registry type "NS (DNS) Registry ".
  • Under "Record Parameters" - Subdomain: enter the relevant subdomain, in this example "subdomain".
  • Under "Registry Parameters" - Target Server: enter the relevant nameserver, in this example "dn3.swhosting.com".
  • In "Registry parameters" - Host IP: enter the IP of the corresponding nameserver, in this example "81.25.112.3".

Then click on the "Create Registry" button.

.

5. We will repeat step 4 but this time adding the values of the secondary nameserver, in our example:

  • In "DNS Zone Detail" - Registry Type: select the registry type "NS (DNS) Registry ".
  • Under "Record Parameters" - Subdomain: enter the relevant subdomain, in this example "subdomain".
  • In "Registry Parameters" - Target Server: enter the relevant nameserver, in this example "dn4.swhosting.com".
  • In "Registry Parameters" - Host IP: enter the IP of the corresponding nameserver, in this example "81.25.112.4".

.

Finally, the records should look like this in the DNS zone:

.

Once the zone delegation is done, we will have our subdomain ready and operative at dns level.