CS · EN

DNS - Subdomains


This article addresses the setup of a subdomain on a domain (in DNS). Typically, this is a subdomain that points to a different service 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 a domain and subdomains on it, follow the guide Webhosting – Subdomains.

You will mainly use subdomain setup in DNS if the subdomain is hosted on another service (a second Webhosting, WebSite, …), or with another provider:

  • If you are setting up a subdomain for a new WEDOS service, you can check automatic DNS setup in the order form. If you do not have DNS set up automatically, follow the instructions in the chapter Subdomain via A and AAAA records.
  • For services from another provider, first obtain instructions for pointing the domain to that service. The instructions will tell you whether the subdomain should be set up using A (or AAAA) records, CNAME, or both.

Before setting up subdomains in WEDOS DNS, make sure that the domain really uses our DNS servers (NSSET). Many hosting provider guides include a DNS server change. If you are not sure about this change, avoid it. If you change the DNS servers, records maintained on the original servers will stop working.


Subdomain via A and AAAA records

If you know the IPv4 or IPv6 address of the server, you can point the subdomain using A records, or AAAA records. Instructions for obtaining these addresses for VEDOS services can be found in the setup email or in the service detail according to the guide DNS – A and AAAA Records.

If you have the service addresses ready, enter the DNS record administration according to the guide DNS – Domain Records.

Enter the records according to the following schema. If your service does not support A or AAAA records, you can enter only 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 separately without the domain name. For example, the name www is correct, www.domena.tld is not.


Subdomain via CNAME record

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

A CNAME record excludes the setup of any additional records for the same subdomain.

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

If you have the domain ready to which the CNAME record should point, enter the DNS record administration according to the guide DNS – Domain Records.

Enter the record according to the following schema:

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 there is a record of any type (including TXT) for any subdomain, all * records cease to apply to that subdomain, including those of other types.

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

HTTPS certificate for the subdomain

Problem: A domain set up in DNS cannot be added to an HTTPS certificate; an error message appears:
There was a problem adding the following domains to the Lets Encrypt certificate:
www.sub.domena.tld – the domain has no DNS records set
.

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

Cause: By default, the certificate setup for subdomains has the option to add the www variant checked. This can be problematic if you are adding a subdomain with its own DNS record.

Solution: Either uncheck 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.domena.tld does not work

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

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

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


Frequently asked questions

Should I also set up the subdomain on the webhosting?

The server to which the subdomain points should definitely be configured to handle the subdomain correctly. For our Webhosting, it is enough for it to be named according to the domain or subdomain, and the subdomain files to be placed in accordance with the guide Webhosting – Subdomains. WebSite must be named exactly according to the subdomain (without www).

How do I enable HTTPS on the subdomain?

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