Free tools Windows power users keep installed
One-click scans. No signup required.
Point both domains’ A records—and AAAA records if your VPS uses IPv6—to the VPS public IP, then configure your web server to accept both hostnames. NGINX does this with server_name; Apache uses ServerName and ServerAlias. Finally, install HTTPS certificates covering every hostname and decide whether both domains remain visible or the second domain permanently redirects to one canonical URL.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What “point two domains to one website” actually involves
A domain name reaches a website through two separate layers. DNS tells a browser which server address to contact. The web server then examines the hostname in the request and chooses the site configuration that should answer. Configuring only one layer is not enough: DNS can send both names to your VPS while the server still serves the wrong site, and a virtual-host definition cannot make a name resolve if DNS points elsewhere.
As an Amazon Associate I earn from qualifying purchases.
Assume the primary domain is example.com, with www.example.com as an optional alias, and the second domain is second.example. Replace those names with your real domains. The same pattern works for more than two domains.
- DNS: Create records for each hostname at the authoritative DNS service.
- HTTP routing: Tell NGINX or Apache that the names belong to the same website.
- TLS: Use certificates that contain every HTTPS hostname.
- URL policy: Keep both domains active, or redirect the alternate domain to one canonical address.
Choose the URL policy before changing configuration
Both domains stay active
With this model, https://example.com/page and https://second.example/page both return the website without changing the address shown in the browser. This is useful when the domains represent genuinely different entry points, campaigns, regional names, or legacy addresses that must continue to display. Every active hostname needs correct DNS, web-server matching, and certificate coverage.
#1 Best Overall
The trade-off is that search engines, analytics, cookies, and users can encounter two public URLs for the same content. If you use this model, set your application’s canonical-link policy deliberately and verify that sessions, absolute links, and redirects behave correctly on either host.
One canonical domain, one permanent redirect
Most sites choose one public domain and redirect the other. For example, every request for second.example can return an HTTP 301 response to the equivalent HTTPS URL on example.com. This consolidates bookmarks and signals that the canonical host is the destination.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The alternate name still needs DNS and normally needs a port-80 web-server configuration so certificate validation and the redirect can work. If your certificate automation uses an HTTP challenge, do not redirect or block /.well-known/acme-challenge/ on port 80; allow the challenge request to be served as required by your ACME client.
Step 1: Point both domains at the VPS in DNS
Find the address to publish
Use the VPS provider’s public IPv4 address for an A record. If the VPS has a publicly reachable IPv6 address and you intend to serve IPv6 traffic, publish an AAAA record as well. Do not use a private address from an internal network.
Create records for the exact hostnames
At the authoritative DNS provider for each domain, create records similar to these:
| Hostname | Record | Value | Purpose |
|---|---|---|---|
@ (the apex) |
A | VPS public IPv4 | Resolves example.com |
www |
A | VPS public IPv4 | Resolves www.example.com, if used |
@ (second domain) |
A | VPS public IPv4 | Resolves second.example |
| Each published hostname | AAAA | VPS public IPv6 | Optional IPv6 resolution |
Some DNS control panels display the apex as @; others show the full domain. Enter the value exactly as that provider documents. If an existing A or AAAA record points to another server, replace it only when that change is intended. Remove stale records that would send some users to an old VPS.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →A DNS change may be cached according to the record’s TTL. Test from more than one network if a change appears inconsistent. A resolver can continue returning the old address until its cached TTL expires.
Rank #2
- Used Book in Good Condition
Check DNS before touching the web server
From a workstation, query each name:
dig +short example.com A
dig +short www.example.com A
dig +short second.example A
dig +short example.com AAAA
dig +short second.example AAAA
Each query should return the address you intend to use. An empty response means that record type is not published; an unexpected address usually indicates a stale record, a split-DNS setup, or that the domain’s nameservers are managed somewhere other than the panel you edited. DNS must resolve before users can reach the virtual host.
Step 2: Configure NGINX for one website and two domains
Serve the same content on both names
NGINX chooses a server block by matching the request hostname against server_name. Put every hostname that should serve the same content in one block. A minimal HTTP pattern is:
server {
listen 80;
server_name example.com www.example.com second.example;
root /var/www/site;
index index.html index.php;
# Add your normal location rules here.
# location / { ... }
}
Keep your existing application-specific location, proxy, PHP, access-log, and security directives; the important change is the complete server_name list and the shared document root or upstream. If you publish an IPv6 address, ensure the listener also accepts IPv6 according to your operating system and NGINX configuration, for example with an appropriate IPv6 listen directive.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Redirect the second domain to the canonical domain
When only example.com should remain public, use a separate port-80 block for the alternate name:
server {
listen 80;
server_name second.example;
location ^~ /.well-known/acme-challenge/ {
root /var/www/acme;
}
location / {
return 301 https://example.com$request_uri;
}
}
Keep a separate block for the canonical domain that serves the site and, if desired, redirects its HTTP traffic to HTTPS. The $request_uri variable preserves the path and query string in the redirect. If the alternate domain also has a www form, list that hostname in the redirect block or create another matching block.
Test and reload safely
Run NGINX’s configuration test before reloading:
sudo nginx -t
Only reload after the test reports a valid configuration:
sudo systemctl reload nginx
A reload applies the new configuration without intentionally stopping existing workers. If the test reports an unknown directive, duplicate default server, missing semicolon, or certificate-file error, correct that issue first rather than forcing a reload.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #3
Step 3: Configure Apache for one website and two domains
Use name-based virtual hosting
Apache supports multiple names on one IP through name-based virtual hosts. Set the primary hostname with ServerName and the additional hostnames with ServerAlias:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com second.example
DocumentRoot /var/www/site
<Directory /var/www/site>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Use the directory permissions and override policy your application requires; AllowOverride All is only an example and may be broader than necessary. If the site is reverse-proxied to an application server, retain the existing ProxyPass and related directives instead of adding a static document root.
Redirect the alternate name
For a canonical URL, give the alternate hostname its own virtual host and redirect it:
<VirtualHost *:80>
ServerName second.example
ServerAlias www.second.example
Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
<Directory /var/www/acme/.well-known/acme-challenge/>
Require all granted
</Directory>
Redirect permanent / https://example.com/
</VirtualHost>
The challenge-location directives are illustrative; configure the path expected by your certificate automation. Ensure that the challenge remains reachable before requesting or renewing a certificate.
Validate Apache before reloading
Check syntax and virtual-host parsing:
sudo apachectl configtest
sudo apachectl -S
The first command should report a successful syntax check. The second helps reveal which virtual host Apache associates with each name and whether another default host is unexpectedly catching requests. Reload only after correcting errors:
sudo systemctl reload apache2
The service name can differ by distribution. Use the service name installed on your VPS rather than assuming that every operating system uses apache2.
Step 4: Enable HTTPS for every hostname
Choose certificate coverage
Any hostname that users open with https:// must appear in the certificate presented for that connection. A single certificate can contain multiple names, such as the apex, its www alias, and the second domain. Separate certificates are also possible when your automation and server layout make that easier.
Rank #4
| Certificate arrangement | When it fits | What to verify |
|---|---|---|
| One multi-name certificate | Both domains share a straightforward HTTPS configuration. | Every accepted hostname is included as a certificate name and the correct certificate is attached to the server. |
| Separate certificates | Domains have separate virtual hosts, renewal schedules, or administrative boundaries. | Each HTTPS virtual host serves its own matching certificate and private key. |
Understand SNI and certificate selection
Modern browsers send the requested hostname during the TLS handshake using Server Name Indication (SNI). NGINX or Apache can then select the certificate and virtual host for that name on the same IP address. SNI does not fix an incomplete configuration: the hostname still needs a matching HTTPS server block and a certificate containing that name. A missing name commonly produces a browser certificate warning or the certificate belonging to another virtual host.
Keep port 80 available for validation and redirects
Certificate automation that uses an HTTP challenge must reach the challenge URL on port 80. Configure the challenge path before issuing or renewing the certificate, then redirect ordinary HTTP requests to the canonical HTTPS URL. Do not assume that a blanket redirect automatically handles the challenge; test the exact /.well-known/acme-challenge/ path used by your ACME client.
Attach certificates to HTTPS virtual hosts
Create an HTTPS server block in NGINX or an HTTPS virtual host in Apache with the same complete hostname list used for DNS. Point the configuration at the certificate and private-key files produced by your certificate automation. For a shared-content model, all active names can be listed together. For a redirect model, configure HTTPS for the alternate name as well, then return a 301 to the canonical HTTPS URL. Otherwise, users who type the alternate HTTPS address will fail before the redirect can run.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Step 5: Validate the complete path from name to page
Verify DNS answers
Repeat the dig checks after propagation. Confirm that A and AAAA records do not point to different servers unless that split is intentional. If IPv6 is published but the VPS firewall or web server is not listening on IPv6, some users may fail while IPv4 users succeed; either complete IPv6 setup or remove the unusable AAAA record.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Check HTTP behavior for each name
curl -I http://example.com/
curl -I http://www.example.com/
curl -I http://second.example/
For an active multi-domain site, expect the appropriate application response. For an alternate domain, expect a 301 whose Location points to the canonical HTTPS URL. Check both the apex and www forms if you publish both.
Check HTTPS and certificate names
curl -I https://example.com/
curl -I https://second.example/
Confirm that each request completes without a certificate warning and returns the intended status or redirect. Inspect the certificate in a browser or with your TLS inspection tooling and verify that every hostname appears in its Subject Alternative Name list. A certificate for only example.com does not cover second.example.
Confirm the server selected the intended site
Use response headers, a temporary unique test file, or application logs to distinguish the two virtual hosts. When testing a new DNS configuration before propagation, send the hostname explicitly to the VPS address with a tool that supports host-header or SNI testing; do not conclude that routing works merely because the IP responds.
Best Value
Common failure modes and fixes
Both domains show the default site
Usually DNS reaches the VPS but no server block matches the requested hostname. Check spelling, trailing dots, and whether the configuration file is enabled. In NGINX, verify the name is in server_name. In Apache, verify ServerName or ServerAlias and inspect apachectl -S.
One domain works, the other times out
Compare A and AAAA answers. A stale record, an unconfigured IPv6 listener, a firewall rule, or DNS still delegated to another provider can affect only one name or address family. Confirm that the VPS firewall allows ports 80 and 443 and that the web server listens on the public interfaces.
HTTP works but HTTPS warns
The certificate probably omits the hostname, or the HTTPS virtual host serves a different certificate. Include every active name in the certificate request and attach the resulting files to the matching HTTPS configuration. Reload only after the configuration test succeeds.
The redirect loops
A loop occurs when the server redirects an already canonical HTTPS request back to HTTP or when an upstream proxy’s HTTPS state is not conveyed correctly. Test the redirect chain with curl -I, identify the exact Location values, and ensure the canonical HTTPS virtual host serves content rather than redirecting to itself.
Certificate renewal fails after adding a redirect
Check that port 80 is reachable and that the exact challenge path is exempted from the catch-all redirect or is served by the ACME client’s challenge handler. Test the path during renewal, then rerun the certificate automation and inspect its logs for the hostname that failed.
Recommended Free Tools
NGINX and Apache: which configuration model fits?
| Decision point | NGINX | Apache |
|---|---|---|
| Hostname matching | server_name selects the server block. |
ServerName identifies the primary name; ServerAlias adds names. |
| Shared content | List all names in one block and use one root or upstream. | List aliases in one name-based VirtualHost. |
| Canonical redirect | Use a dedicated alternate-name block with return 301. |
Use a dedicated alternate-name virtual host with a permanent redirect. |
| HTTPS scaling | SNI selects the matching certificate and server block. | SNI selects the matching certificate and virtual host. |
| Pre-reload check | nginx -t |
apachectl configtest and, for mapping visibility, apachectl -S |
Neither server requires a separate IP for each name. Both support name-based hosting, so one VPS address can serve multiple domains as long as DNS, hostname matching, and TLS are aligned.
A repeatable checklist for future domains
- Decide whether the new domain remains visible or redirects to an existing canonical domain.
- Publish A records for the apex and any
wwwnames; publish AAAA records only when IPv6 is correctly served. - Wait for DNS caches to update and confirm answers with
dig. - Add the hostname to NGINX
server_nameor ApacheServerName/ServerAlias. - For a redirect policy, create a dedicated alternate-domain HTTP and HTTPS configuration.
- Ensure
/.well-known/acme-challenge/remains reachable on port 80 during certificate issuance and renewal. - Issue or renew a certificate containing every hostname that accepts HTTPS.
- Run
nginx -torapachectl configtest, inspect virtual-host mappings, and reload. - Test every hostname over HTTP and HTTPS, including apex and
wwwvariants. - Confirm the final status codes, redirect destinations, certificate names, logs, and application behavior.
Final decision
Two domains can safely share one VPS, one public IP, and one website. DNS makes both names reach the machine; NGINX or Apache decides which configuration answers; TLS certificates make each HTTPS name trustworthy. Once those layers agree, choose one deliberate URL policy—serve both names or permanently redirect the alternate—and test every hostname, address family, protocol, and certificate after each change.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




