This document explains virtual hosts and how cPanel & WHM handles them.
An overly-simplified representation of Internet hosting...
The following overly-simplified outline represents how internet hosting works:
The user requests content from a remote host at a hostname (for example, the
In most cases, the term domain name can act as a synonym for hostname.
- The user’s computer resolves the hostname to an IP address (for example,
- The user’s computer connects to the host with that IP address (
22.214.171.124) and retrieves the content.
How it really works...
Two significant factors complicate the overly-simplified outline:
- Multiple hostnames may resolve to the same IP address (for example,
www.example.comare different hostnames that likely resolve to the same IP address).
- A shared IP address can serve each hostname's content as long as the user’s computer tells the remote host which hostname’s content to transmit.
To allow multiple hostnames to share content via a shared IP address, we change step 3 above. The user's computer first tells the remote host the hostname's content that it wants. This way, a server that hosts content for the example.com hostname can serve completely different content for the anotherexample.com hostname. This happens even though those two hostnames use the same IP address. To the user, the content seems to originate from two different hosts. Because of this, we can say that the remote host has two different virtual hosts (or vhosts) for these names.
A user who requests
example.com content and a user who requests
anotherexample.com content will receive different content. However, a host can also serve the same content for two different hostnames. For example, most users expect the same content from the
www.example.com hostname as when they visit the
example.com hostname. Therefore, these two hostnames exist on the same virtual host or vhost.
The rest of this document discusses virtual hosts as they pertain to web hosting. However, virtual hosts can also apply to other services, such as FTP or email.
How cPanel & WHM handles web virtual hosts
cPanel & WHM streamlines how the system handles hostnames and virtual hosts in order to satisfy most common-use cases. Even though this reduces account flexibility, it guides users to generally-desirable configurations.
Every cPanel account owns at least one web virtual host that contains two hostnames:
- The account’s primary domain name.
- The equivalent
www.subdomain of the account’s primary domain name.
So, if you create the cPanel account
example with a primary domain of
example.com, then HTTP requests for the hostnames
www.example.com will retrieve the same content.
cPanel users can manage three different types of additional hostnames in the Domains group of features:
(previously Parked Domains )
A separate hostname that the virtual host associates with the account’s primary domain. For example, you can use an alias so that requests to the
Aliases also configure the equivalent
AutoSSL providers count aliased domains towards their domain and rate limits for virtual hosts.
A hostname that uses the same domain name root as the account’s primary domain or a parked domain, but exists on a separate virtual host (for example,
As with aliased domains, the system automatically creates an equivalent
A separate hostname on a separate virtual host. To accomplish this, cPanel creates a subdomain with the same root as the account’s primary domain (for example, for the
Then, cPanel creates the addon domain as an alias of the subdomain (for example, cPanel creates
As with aliased domains and subdomains, the system automatically creates an equivalent
SSL-encrypted web content
In order to serve SSL-encrypted web content, cPanel creates a new virtual host that mirrors the non-SSL virtual host. This new virtual host adds the necessary configuration parameters for SSL. The same hostnames associate with the new virtual host and the old one, and both virtual hosts use the same document root.
Each virtual host can only support one SSL certificate.