What is a domain alias?
A domain alias is a secondary domain name that points to the same website, application, or content as a primary domain. When configured correctly, multiple domain names can serve identical content, providing users with different ways to reach the same destination.
Domain alias vs. domain forwarding
| Feature | Domain Alias | Domain Redirect/Forward |
|---|---|---|
| URL in browser | Shows alias domain | Shows primary domain |
| Content served | From same site | Redirects then serves |
| HTTP status | 200 OK | 301/302 Redirect |
| SEO impact | Duplicate content risk | Consolidates to primary |
| DNS setup | A/AAAA or CNAME | Usually A/AAAA + redirect |
| Can share email | Separate email config |
User types: shop.example.com
Browser shows: shop.example.com
Content from: example.com (same server, same content)
Domain Redirect (URL changes):
User types: shop.example.com
Browser redirects to: example.com
Browser shows: example.com
Configuring domain aliases
DNS configuration
Both domains point to the same server:
# Primary domain
example.com. IN A 203.0.113.50
# Alias domain
example.net. IN A 203.0.113.50
shop-example.com. IN A 203.0.113.50
Or using CNAME for alias:
shop.example.com. IN CNAME example.com.
Web server configuration
#### Apache
<VirtualHost *:80>
ServerName example.com
ServerAlias example.net shop.example.com www.example.net
DocumentRoot /var/www/example
<Directory /var/www/example>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#### Nginx
server {
listen 80;
server_name example.com example.net shop.example.com;
root /var/www/example;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
}
#### Cloudflare (CNAME setup)
1. Add alias domain to Cloudflare
2. Create CNAME record:
shop.example.com → example.com
3. Enable "Flatten all CNAMEs" in DNS settings
4. Enable "Always Use HTTPS"
cPanel/WHM
Addon Domain (creates new site):Domains → Addon Domains → Create New Domain
Alias/Parked Domain (points to existing site):
Domains → Aliases → Create a New Alias
Enter domain: shop.example.com
Alias for: example.com
Common use cases
Brand variations
Register common variations to prevent cybersquatting:
example.com (primary)
example.net (alias)
example.org (alias)
example.io (alias)
Typo protection
Capture common misspellings:
example.com (primary)
exampel.com (alias - typo)
exmple.com (alias - typo)
Regional domains
Serve same content on country-specific TLDs:
example.com (primary, global)
example.co.uk (alias, UK)
example.de (alias, Germany)
example.fr (alias, France)
Note: For true internationalization, use hreflang tags and localized content instead.
Marketing campaigns
Short, memorable campaign domains:
example.com (primary site)
summerosale2024.com (alias for campaign landing page)
Subdomain aliases
shop.example.com (alias)
store.example.com (alias)
→ Both serve same e-commerce site
Product or service branding
companyname.com (primary)
productname.com (alias)
SEO considerations for domain aliases
Duplicate content problem
Search engines may see domain aliases as duplicate content:
example.com/about
example.net/about
→ Same content, different URLs = duplicate
Consequence: Split authority, lower rankings.
Canonical tags
Tell search engines which domain is primary:
<!-- On all pages, regardless of domain -->
<link rel="canonical" href="https://example.com/page-path" />
This tells search engines "treat all versions as this URL."
Preferred solution: 301 Redirects
Instead of aliases, redirect to primary domain:
Apache (.htaccess):RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
Nginx:
server {
listen 80;
server_name example.net shop.example.com;
return 301 https://example.com$request_uri;
}
This consolidates all SEO authority to the primary domain.
When aliases are acceptable
- Internal/development domains (not indexed)
- Domains with
noindextags - Domains used for email only (no web content)
- Temporary campaign domains with canonical tags
Email configuration for domain aliases
Shared email (same mailboxes)
Configure MX records for all domains:
example.com. IN MX 10 mail.example.com.
example.net. IN MX 10 mail.example.com.
[email protected] and [email protected] → same mailbox
Separate email (different mailboxes)
Each domain has independent email:
example.com. IN MX 10 mail.example.com.
example.net. IN MX 10 mail.example.net.
[email protected] ≠ [email protected] (different mailboxes)
Email catch-all across aliases
Accept email to any address on any alias domain:
# Postfix virtual
@example.com [email protected]
@example.net [email protected]
@shop.example.com [email protected]
SSL/TLS certificates for aliases
Multi-domain (SAN) certificate
One certificate covering all aliases:
Certificate SANs:
example.com
www.example.com
example.net
www.example.net
shop.example.com
Let's Encrypt:
certbot certonly --nginx \
-d example.com -d www.example.com \
-d example.net -d www.example.net \
-d shop.example.com
Wildcard certificate
Covers all subdomains of primary domain:
*.example.com
→ Covers shop.example.com, blog.example.com, etc.
→ Does NOT cover example.net or other TLDs
Separate certificates
Individual certificate per domain:
example.com → cert1
example.net → cert2
Best practices
Always use HTTPS for all aliases
Every domain should have valid SSL:
✓ https://example.com
✓ https://example.net
✓ https://shop.example.com
Implement canonical tags
Even if serving same content, use canonical tags:
<link rel="canonical" href="https://example.com/current-page" />
Consider 301 redirects over aliases
For SEO, redirect aliases to primary:
example.net → 301 redirect → example.com
shop.example.com → 301 redirect → example.com/shop
Monitor all domains
Include all aliases in uptime monitoring:
- Monitor DNS resolution for all aliases
- Check SSL certificate validity
- Verify web server responds correctly
Consistent branding
If using aliases, ensure consistent branding:
Same logo, colors, navigation across all domains
Or clearly indicate relationship
Document alias strategy
Maintain documentation:
# domains.md
Domain Type Purpose Points To example.com Primary Main site Server A example.net Alias Brand protection Server A shop.example.com Alias E-commerce Server A
Testing domain aliases
Verify DNS resolution
# Check all aliases resolve to same IP
dig example.com A +short
dig example.net A +short
dig shop.example.com A +short
# Should all return same IP or equivalent CNAME chain
Test web server configuration
# Verify server responds to all domains
curl -I https://example.com
curl -I https://example.net
curl -I https://shop.example.com
# Should all return 200 OK (or 301 if redirecting)
Check SSL certificates
# Verify SSL covers all domains
echo | openssl s_client -servername example.net -connect example.com:443 2>/dev/null | openssl x509 -noout -text | grep DNS
# Should list all alias domains in SANs
SEO validation
# Check canonical tags
curl -s https://example.net/page | grep "canonical"
# Should point to primary domain
<link rel="canonical" href="https://example.com/page" />
Security considerations
Domain hijacking risk
More domains = more attack surface:
- Monitor all domains for unauthorized changes
- Use registry lock on important aliases
- Enable 2FA at registrars
Phishing protection
Register defensive aliases to prevent phishing:
example.com (primary)
examp1e.com (homoglyph protection)
example-secure.com (defensive)
Consistent security policies
Apply same security to all aliases:
- Same HSTS headers
- Same CSP policies
- Same authentication requirements
Domain aliases are useful for brand protection and user convenience but require careful configuration to avoid SEO penalties and security risks.