Knowledge Base›DNS›Subdomains

DNS – Subdomains

On this pageSubdomains in DNSSubdomain using A and AAAA recordsSubdomain using a CNAME recordCommon problemsFrequently Asked Questions

This article covers setting up a subdomain on a domain (in DNS). This is typically a subdomain that points to a service other than the domain’s Webhosting. To create a subdomain on Webhosting, follow the guide Webhosting – Subdomains.

In this article, you will learn:


Subdomains in DNS

If you have VEDOS Webhosting and want to run both the domain and subdomains on it, follow the guide Webhosting – Subdomains.

You will mainly use subdomain setup in DNS when you run the subdomain on a different service (a second Webhosting, WebSite, …) or with another provider:

  • If you are creating a subdomain for a new WEDOS service, you can tick automatic DNS setup in the order. If your DNS was not set up automatically, follow the guide in the chapter Subdomain using A and AAAA records.
  • For services from another provider, first obtain the guide for pointing a domain to that service. The guide will tell you whether to set up the subdomain using A records (or AAAA), CNAME, or both.

Before setting up subdomains in WEDOS DNS, make sure the domain really uses our DNS servers (NSSET). Many hosting providers’ guides include changing DNS servers. If you are not sure about this change, avoid it. If you change DNS servers, the records kept on the original ones will stop working.


Subdomain using A and AAAA records

If you know the server’s IPv4 or IPv6 address, you can point the subdomain using A or AAAA records. You can find how to get these addresses for VEDOS services in the setup email or in the service detail, following the guide DNS – A and AAAA Records.

Once you have the service addresses ready, open the DNS records administration following the guide DNS – Domain Records.

Enter the records according to the following scheme. If your service does not support A or AAAA records, you can enter just one of these types.

Name              TTL    Type  Data
(subdomain-name) 300 A (server IPv4 address)
(subdomain-name) 300 AAAA (server IPv6 address)

Always enter the subdomain name on its own, without the domain name. For example, the name www is correct, www.domain.tld is not.


Subdomain using a CNAME record

VEDOS does not use CNAME records for its hosting services, but many external services do. If you can choose whether to set up the subdomain using an A/AAAA or a CNAME record, choose just one of these options. 

A CNAME record excludes any other records for the same subdomain.

The domain or subdomain that the CNAME record points to must have a valid A or AAAA record.

Once you have the domain the CNAME record should point to ready, open the DNS records administration following the guide DNS – Domain Records.

Enter the record according to the following scheme:

Name              TTL    Type   Data
(subdomain-name) 300 CNAME (service-domain)

Common problems

Common problems when setting up subdomains in DNS include:

The * record does not work correctly

Problem: After adding a record for a subdomain, the * record stopped working.

Cause: If a record of any type (including TXT) exists for a given subdomain, all * records, including those of other types, stop applying to that subdomain.

Solution: Either add to the subdomain the missing records that were otherwise set up via the * record, or delete the records causing the conflict.

HTTPS certificate for a subdomain

Problem: A domain created in DNS cannot be added to an HTTPS certificate, and an error message appears:
A problem occurred while adding the following domains to the Lets Encrypt certificate:
www.sub.domain.tld – the domain does not have DNS records set up
.

Error message when adding a subdomain to a certificate
Error message when adding a subdomain to a certificate

Cause: By default, the subdomain certificate settings have the option to add the www variant of the subdomain ticked. This is often problematic if you are adding a subdomain with its own DNS record.

Solution: Either untick the option add the www variant to each subdomain or create another record for the www version of the subdomain.

Issuing a certificate for subdomains without the www variant
Issuing a certificate for subdomains without the www variant

sub.domain.tld does not work

Problem: The subdomain named sub.domain.tld does not work.

Cause: In the record name, you enter only the subdomain name (sub) without the domain name (domain.tld).

Solution: Delete the record named sub.domain.tld and create a new one named sub, copying the rest of the settings from the previous record.


Frequently Asked Questions

Do I need to set up the subdomain on Webhosting as well?

The server the subdomain points to should definitely be configured to process the subdomain correctly. With our Webhosting, it is enough that it is named after the domain or subdomain and that the subdomain files are placed according to the guide Webhosting – Subdomains. WebSite must be named exactly after the subdomain (without www).

How do I activate HTTPS on a subdomain?

You set up HTTPS on Webhosting. Follow the guide Webhosting – Subdomains.

Was this article helpful?

Your feedback helps us improve our articles.

Your message goes to the documentation team, who do not reply to it. If you need help, contact us using the contact form. Do not include passwords or personal data.

Didn't find what you were looking for?

Ask other customers on the Help community website.