2.1.4 How to Create Subdomains and Automatic Subdomains
All domain names are of different levels, separated by a dot .
For example, the domain UA
is a 1st-level domain. The domain com.ua
is a 2nd-level subdomain of the UA domain, and the domain thehost.com.ua
is a 3rd-level subdomain of the com.ua domain, and so on.
In essence, any domain name is a subdomain of the domain of the previous level.
Subdomain as a Separate Domain, WWW Domain
Adding a subdomain to the hosting control panel can be done just like adding any other domain.
This way, you will have the opportunity to fully manage all DNS records of the subdomain, create subdomains of the next levels for it, create mailboxes based on it, and exercise full control over the site settings. However, such a subdomain will occupy one quota unit for the number of sites and the number of domains for your hosting.
If there is a need to create only a separate site on a subdomain without managing DNS and without separate mail on the subdomain, you can do it like this:
1. Go to the hosting control panel ISPmanager in the WWW domains section and click on the Create button.
2. In the pop-up window, fill in the necessary fields. The domain name is entered according to the principle subdomain.yourdomain.zone
.
3. Click OK, the subdomain is created. The location of the files for it should be at /www/subdomain.yourdomain.zone/
.
Such a subdomain will occupy one quota unit for the number of sites, but will not occupy a quota for the number of domains for your hosting.
Note: for the proper functioning of subdomains, some time may be required after creation. This is related to DNS update because to work with a subdomain, an A record must be created pointing to the hosting/server IP.
Auto Subdomains in ISPManager Panel
To enable auto subdomains in ISPmanager, go to the WWW domains menu, and then, in the properties of the selected WWW domain, activate the Auto Subdomains option:
Auto subdomains do not occupy your quotas for the number of sites or domains.
Auto subdomains inherit all the settings of the main domain and work in the same mode and PHP version as the main domain. There is no possibility to manage your own DNS records, create further subdomains, even www.yourdomain
, create mailboxes for them, set up redirects and aliases. Also, there is no possibility to view statistics and logs for individual auto subdomains—they are all common for the main domain.
Warning: to make auto subdomains work, it is necessary to set our nameservers at the registrar of the main domain and specify *.your.domain
in the aliases in the properties of the WWW domain:
The panel will offer you two implementation options for the auto subdomains function. Below, we will consider their working principles.
Auto Subdomains in Separate Directory
The files of subdomains will not be accessible from the main domain; you need to create them in folders corresponding to the subdomain name in the user’s home directory in the www directory, for example:
1. The domain yourdomain.com
is located in the folder www/yourdomain.com
.
2. There is a need to create the domain subdomain.yourdomain.com
.
3. To operate with this configuration, the files of the subdomain should be placed in the directory www/subdomain.yourdomain.com
.
Auto Subdomains in Subdirectory of WWW Domain
The files of subdomains will be accessible from the main domain; you need to create them in folders corresponding to the subdomain name in the user’s home directory in the owner’s www/yourdomain.com directory
, for example:
1. The domain yourdomain.com
is located in the folder www/yourdomain.com
.
2. There is a need to create the domain subdomain.yourdomain.com
.
3. To operate with this configuration, the files of the subdomain should be placed in the directory www/yourdomain.com/subdomain
. In this case, the data will also be accessible at yourdomain.com/subdomain
.