Creating an alias (formerly known as a parked domain) allows you to point multiple domains to a single website. This can be useful if you own multiple domain names and want them to direct users to the same content, or if you want to capture traffic from different domain spellings or extensions (like .com, .org, .net). Domain aliases do not have unique content; they simply redirect visitors to the primary domain.
This extended guide will walk you through the process of creating an alias for your domain in different environments such as cPanel, Plesk, and manual setups with Apache or NGINX.
What Is an Alias (Parked Domain)?
A domain alias allows one domain to point to another domain without having its own distinct content. For example, if you own myprimarydomain.com and you also purchase mydomainalias.com, setting up a domain alias will ensure that visitors to mydomainalias.com will be directed to the same content served on myprimarydomain.com.
Aliases are often used for:
Protecting your brand by purchasing multiple domain extensions (e.g., .com, .net, .org).
Ensuring users find your website even if they type in a similar but incorrect domain name.
Redirecting traffic from outdated or previously used domains to a new site.
A. Creating a Domain Alias in cPanel:
Most shared hosting environments use cPanel, and it provides an easy way to create an alias for your domains.
Steps to Create an Alias in cPanel:
Login to cPanel:
Open your web browser and go to https://yourdomain.com/cpanel.
Enter your cPanel credentials to access your hosting control panel.
Navigate to the “Aliases” Section:
Once logged in, scroll down to the Domains section and click on Aliases. (In some versions of cPanel, this section might still be called Parked Domains).
Add the Alias: In the Create a New Alias field, type the domain name that you want to alias (the domain you want to park over the primary domain). For example, if you want mydomainalias.com to point to myprimarydomain.com, enter mydomainalias.com.
Click Add Domain.
Verify DNS Settings
After creating the alias, ensure that the DNS for the alias domain is correctly pointed to the hosting server where your primary domain is hosted.
This typically involves logging into your domain registrar’s dashboard and changing the domain’s nameservers to match those used by your hosting provider.
You can also set up an A Record pointing the alias domain to the same IP address as your primary domain.
Test the Alias:
After the DNS changes propagate (this can take anywhere from a few minutes to 24 hours), visit the alias domain (e.g., mydomainalias.com) in your browser.
You should see the content from your primary domain (e.g., myprimarydomain.com).
B. Creating a Domain Alias in Plesk:
Plesk also makes it easy to create domain aliases. Here’s how to do it in a Plesk-managed hosting environment.
Steps to Create an Alias in Plesk:
Login to Plesk:
Open your web browser and go to your Plesk login page (usually https://yourdomain.com:8443).
Enter your Plesk username and password.
Navigate to “Websites & Domains”:
In the Plesk dashboard, find the Websites & Domains tab on the left-hand menu and click on it.
Add Domain Alias:
Under the Websites & Domains section, click on Add Domain Alias.
Select the primary domain you want the alias to point to, then enter the domain name you wish to park (the alias domain).
Configure the Alias Settings:
You’ll have a few options during the setup:
Mail Service: Decide if you want emails sent to the alias domain to forward to the primary domain’s email (e.g., if someone sends an email to info@mydomainalias.com, it will go to info@myprimarydomain.com).
Web Service: Make sure this option is selected if you want the alias domain to point to the primary domain’s web content.
Redirect with the Primary Domain’s Prefix: Choose whether the alias domain should redirect with or without the primary domain’s www prefix.
Save and Test:
Click OK or Add to save your alias configuration.
Ensure the DNS records of your alias domain point to the same server as your primary domain (change nameservers or update the A record to the primary domain’s IP address).
Test the Alias:
Once DNS propagation is complete, visit the alias domain to confirm that it loads the content from the primary domain.
C. Creating a Domain Alias in Apache:
If you manage your server and are using Apache as the web server, you’ll need to manually configure the alias in the Apache virtual host configuration file.
Steps to Create an Alias in Apache:
Access Apache Configuration Files:
Open your server’s terminal and navigate to the Apache configuration directory, typically located at /etc/httpd/conf/ (for CentOS) or /etc/apache2/sites-available/ (for Ubuntu/Debian).
Edit the VirtualHost Configuration
Open the virtual host file for your primary domain. It should look something like this:
3. Add a ServerAlias Directive: To create an alias, add the ServerAlias directive to the virtual host block. This directive allows you to point multiple domains to the same document root:
4. Save and Restart Apache:
Save the changes and restart Apache to apply the new configuration
or for CentOS:
5. Update DNS Records:
Ensure that the DNS records for your alias domain are pointed to the same server as your primary domain.
6. Test the Alias:
Once DNS propagation is complete, visit the alias domain in your browser to verify that it loads the content from the primary domain.
D. Creating a Domain Alias in NGINX:
NGINX, like Apache, also allows you to manually configure domain aliases through its configuration files.
Steps to Create an Alias in NGINX:
Access NGINX Configuration Files:
Open your server’s terminal and navigate to the NGINX configuration directory, typically located at /etc/nginx/sites-available/.
Edit the Server Block Configuration:
Open the configuration file for your primary domain, which should look something like this:
3. Add an Alias Using server_name:
In NGINX, you can add domain aliases by listing them under the server_name directive. Here’s an example:
4. Save and Restart NGINX:
Save the changes to the configuration file and restart NGINX for the changes to take effect:
5. Update DNS Records:
Make sure the DNS for your alias domain points to the same server as your primary domain.
6. Test the Alias:
Once DNS propagation is complete, visit the alias domain to confirm that it displays the content from your primary domain.
DNS Configuration for Domain Alias:
Regardless of the control panel or web server you’re using, it’s important to properly configure the DNS settings for your alias domain. Here’s a general outline of the DNS changes required:
Change Nameservers:
Log into the account where you registered your alias domain.
Update the domain’s nameservers to match those of your hosting provider where the primary domain is hosted.
Create A Record:
Alternatively, you can create an A record that points the alias domain to the same IP address as your primary domain.
For example, if your server’s IP address is 208.115.219.90, set the A record of mydomainalias.com to point to 208.115.219.90.
Why Use Domain Aliases?
Using domain aliases offers several benefits, including:
Brand Protection: Securing multiple domain extensions (e.g., .com, .org, .net) prevents competitors or others from using similar domains.
Improved Accessibility.Aliases help capture traffic from users who might misspell your domain name or enter a different extension.
Domain Redirection: If you’ve rebranded or moved to a new domain, aliasing the old domain to the new one ensures a smooth transition for visitors.
Creating an alias (parked domain) is a simple way to point multiple domains to a single website, ensuring that all traffic is funneled to one central location. Whether you’re using cPanel, Plesk, Apache, or NGINX, the process involves configuring the domain to serve the same content as the primary domain and ensuring DNS settings are properly pointed to your server.
By setting up domain aliases, you can improve your site’s accessibility, protect your brand, and capture traffic from a variety of sources, all while maintaining a single set of website files.