DNS subdomain

Add a subdomain to your DNS

The Domain Name System zone (DNS zone) is the DNS configuration file that handles all of the addressing associated with a domain. You can use it to configure subdomains or the location of an email server. DNS zones contain technical information called records, which route data to the expected destination.

When you configure a subdomain on a DNS, web users can then access the subdomain. You can do this in one click from the OVHcloud Control Panel, by attaching your subdomain to the directory containing the relevant files.

subdomain visual

What is a DNS subdomain?

How DNS works

Each computer or server connected to the internet has an IP address, which makes it accessible to web users. Data that passes through the internet uses this addressing to link users to each other and to web servers, where the websites and applications are hosted.

For example, when you enter a URL or domain name like “mydomain.ovh” in your browser’s search bar, your request is processed by a DNS server that transcribes the written address into an encrypted address. This will give you access to the server, then the website you are looking for.

The same way that a person’s phone number can be found in an address book, a DNS server can find the IP address of a website host using their domain name.

The action of transcribing a URL to an IP address, i.e. responding to a DNS query, is called a DNS resolution (or DNS lookup). This is how your browser can display a website from the remote hosting server.

By providing access to websites, the DNS resolution service is at the heart of how the internet works.

Please note that it is sometimes necessary to configure a specific address for a subdomain. Also, the management of DNS settings specific to a domain name is included in our web hosting plans.

What is a DNS subdomain used for?

Within the same domain, you can create one or more subdomains. This allows you to organise the structure of your website, or group different websites on the same server. By default, the domain and its subdomains are part of the same DNS zone, i.e. they are hosted on the same web server.

You also have the ability to create a delegation, in order to redirect one or more subdomains on another server. It indicates to the DNS server that the files and data relating to these subdomains are stored on a machine separate to the primary domain.

For example, if you have a subdomain that showcases your online store, you can choose “shop.mydomain.ovh”. The same goes for a blog, with “blog.mydomain.ovh”. If you are designing a multilingual website, you can use subdomains to display each language: en.mywebsite.ovh, fr.mywebsite.ovh, etc.

DNS hierarchy

To translate a domain name to an IP address, the DNS service is based on a fully qualified domain name (FQDN).

The FQDN is read backwards by the DNS resolution service, from the last character of the URL to the subdomain block. So the most important information is a full stop, called the root, like here: “mydomain.ovh.

This full stop is not visible when a web user is surfing the internet. However, you can use it to identify the origin of the DNS lookup, i.e. the first server to be queried to find the IP address.

A domain name consists of several parts, separated by a full stop — each of which will constitute a block. The DNS hierarchy resolves each of these blocks from the end to the beginning, to get the website’s final address.

Each internet connection has its own DNS server, which is usually hosted by an internet service provider (ISP) or web hosting provider. This DNS server is doubled by a backup server, which acts as a replacement in the event of the primary server experiencing a technical failure. This guarantees constant availability for the website you are hosting. The DHCP protocol is then responsible for identifying the primary and secondary DNS servers for your connection.

At this point, there are two potential scenarios.

  • The DNS server already knows your domain name, and immediately resolves the IP address. It can do this via a cache system, which increases the execution speed. This DNS cache has a lifetime called Time to Live.
  • The information is not known. The root server then returns the first information to the DNS resolver: the address of the DNS server for the top-level domain (TLD). Then the DNS resolver traces the information back to the subdomain’s DNS zone.

The TLD refers to the domain name’s extension, in our case “.ovh”. Several hundred extensions exist, and new ones are being created regularly. These extensions are managed by 12 organisations, spread across the globe.

The TLD server is responsible for the IP addresses linked to the domain name extension (e.g. ‘.com’, or in this case, ‘.ovh’). Once it is queried by the DNS resolver, the TLD server returns the domain name server’s IP address: “mydomain.ovh”.

In the case of a subdomain, the DNS zone of the domain concerned will be responsible for resolving the final block, “support.mydomain.ovh”.

The DNS hierarchy allows the DNS service’s recursive servers to find a fully qualified domain name, by querying and then ordering the information.

Subdomain delegation

Subdomains can point to the same DNS server as the associated domain name, or to their own DNS zone.

To speed up the loading time for certain webpages or subdomains, some webmasters create a DNS subdomain delegation. This assigns a server to each subdomain.

In this configuration type, the server with the reference name tells the DNS resolver the location of the targeted subdomain.

In our example, if a delegation has been scheduled for the subdomains “support.mydomain.ovh” and “account.mydomain.ovh”, the DNS server for the domain “mydomain.ovh” will redirect the resolver to the dedicated DNS zone for these URLs.

This hierarchical structure ensures that the internet network can quickly resolve requests. With DNS architecture, information is classified and accessible with high availability.

Use cases

DNS management with a subdomain configuration is particularly useful for:  

  • Changing a website’s hosting plan without experiencing page disruptions.
  • Redirecting emails to a new server or email platform.
  • Linking each subdomain to a specific directory.
  • Distributing a website’s workload between different servers.
  • Speeding up the time it takes to load webpages.
  • Redirecting customers from an e-commerce website to a secure payment platform.

The role of a cache in DNS resolution

To speed up future requests for the same domain name, recursive DNS servers will keep the associated IP address in memory (in cache) for a pre-defined period of time. By default, this Time to Live setting is set to 1 hour.

By caching the IP address and its DNS record, the page will load faster the next time you log in.

Subdomain configuration

How do I add a subdomain with OVHcloud?

Various OVHcloud hosting plans include the creation of subdomains. Depending on your plan, you can:

  • Create a subdomain and point it to your OVHcloud web hosting plan, using the multi-site configuration.
  • Create a subdomain and point it to an IP from the OVHcloud Control Panel, in the ‘DNS Zone’ tab.

How do I change a DNS subdomain?

The DNS configuration files for domain names, or DNS zones, can be modified from the OVHcloud Control Panel.

Warning: A configuration error may render your website or email inaccessible. Please take the time to read the full documentation on editing the DNS zone before making any changes.

Create a subdomain on your DNS

There are two strategies for optimising a domain’s web hosting plan:

  • Centralise different websites with subdomains on the same DNS zone, in order to pool your bandwidth quota when traffic is low.
  • Delegate certain subdomains on different directories and servers, in order to speed up page response time as traffic increases.

How to configure a DNS subdomain for a website with a CDN

To configure a subdomain on your DNS server, you need to configure the Content Delivery Network (CDN) from the OVHcloud Control Panel.

DNS subdomain limits

The maximum depth of subdomains is determined by the number of characters supported by the web servers, i.e. 253 characters, including the root point. Each label (or subdomain block) can contain between 2 and 63 characters, with a limit of 127 DNS subdomains.

This means it is possible to configure a subdomain such as “support.hosting.account.mydomain.ovh” on a different IP to the primary domain name and the previous subdomains.

Find all the DNS subdomains for a domain name

As a technical contact or admin of an OVHcloud domain name, you can view the associated DNS subdomains in the “Multisite” tab of the OVHcloud Control Panel.

If your domain name is not registered with OVHcloud, you can use the Semrush organic search tool, or the DNSdumpster service.

 

Contact OVHcloud technical support if you have any questions about your web hosting package, or about using the OVHcloud Control Panel.