Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Apache

How to Connect Your Domain Name to a WordPress Site on a VPS

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pointing a domain at a WordPress VPS requires two separate configurations: DNS must send the domain to the VPS’s stable public IP address, and Nginx or Apache must be configured to serve WordPress for that hostname. Back up the DNS zone, add an apex A record and a www CNAME, wait for propagation, verify with dig, configure both hostnames in the web server, set WordPress’s canonical URL, then issue a TLS certificate and redirect HTTP to HTTPS.

What connecting a domain to a VPS actually involves

A domain does not point directly to a WordPress folder. The connection has several layers that must agree:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • DNS: The authoritative DNS host publishes records that map a hostname such as example.com to the VPS address.
  • Web server: Nginx or Apache receives the request and selects a server block or virtual host by matching the Host header.
  • WordPress: The application uses its WordPress Address and Site Address values to create links, redirects, cookies and media URLs.
  • TLS: A certificate proves the hostname and encrypts HTTPS traffic. It is normally issued only after DNS reaches the VPS.

Changing a DNS record without creating a matching server block can show the default Nginx or Apache page. Creating a server block without correct DNS leaves visitors at the old host or an error. Changing the WordPress URL before the domain works can lock you out. Treat these as separate steps and complete them in that order.

Check the VPS and WordPress prerequisites

This procedure assumes WordPress is already installed with PHP, a database and a functioning web server on a Linux VPS. Before touching DNS, confirm the following:

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
  • The VPS has a public IPv4 address that is stable and reachable from the internet.
  • If the provider assigns an ephemeral address, reserve an Elastic IP or equivalent first. Otherwise, a reboot, stop/start operation or provider migration can silently invalidate the DNS record.
  • You know whether the image uses Nginx or Apache and where the WordPress document root is located.
  • PHP-FPM, the database and the existing local site work when tested through the VPS’s current hostname or temporary address.
  • Inbound TCP ports 80 and 443 can eventually be allowed through the VPS firewall and any provider security group.

Record the public IPv4 address exactly. Do not use a private address such as one beginning with 10., 172.16. through 172.31., or 192.168.; those are not routable from the public internet.

Back up the existing DNS zone

Sign in to the service that is authoritative for DNS. That may be the registrar, a dedicated DNS host or a hosting provider. Export the zone if the interface supports it, or copy every record into a dated text file or spreadsheet before editing anything.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The backup is especially important when the domain already handles email, a shop, an application or separate subdomains. MX records, mail-related TXT records, DKIM and DMARC records, verification records, and unrelated A or CNAME records must survive the web change. Replacing the entire zone with only an A record and a www CNAME can stop email and other services immediately.

Also note which nameservers are currently delegated at the registrar. Editing records at the wrong dashboard has no effect because only the authoritative nameservers answer visitors’ queries.

Choose between changing nameservers and editing records

There are two valid ways to make the web host authoritative for the domain. The right choice depends on what else uses the domain.

Method What changes Use it when Main risk or trade-off
Change nameservers The registrar delegates the entire DNS zone to a new DNS provider. The domain is used only for this website, or you are prepared to recreate every existing record at the new provider. Any record not recreated can disappear, interrupting email, verification services or subdomains.
Edit individual records The current authoritative DNS service remains in place; only web records are changed. Email, a shop, an app or other subdomains must continue operating without a full DNS migration. You must identify and edit the correct records at the authoritative host.

Nameserver changes can take up to 72 hours to be seen everywhere, according to WordPress.com Support guidance reviewed in 2026. Individual record changes are also cached, but their visibility is governed mainly by each record’s TTL and resolver cache. Neither method changes the files on the VPS; both only determine where a hostname is sent.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Add the apex and www web records

At the authoritative DNS host, create an A record for the apex domain and a CNAME for www. In many interfaces, the apex name is entered as @; some providers expect the bare domain instead. Follow that provider’s exact field labels.

Type Name Value TTL Purpose
A @ 203.0.113.10 3600 seconds in this illustrative configuration Sends the root domain to the VPS IPv4 address.
CNAME www example.com 3600 seconds in this illustrative configuration Makes www.example.com follow the apex domain.

The address 203.0.113.10 is documentation-only. Replace it with the VPS’s real public IPv4 address. A TTL of 3600 seconds is an example, not a universal requirement; the DNS provider may display it in seconds or offer preset values.

Preserve mail and unrelated records

Leave MX records and their associated TXT records untouched. Keep records for services such as mail, shop, app and verification hosts unless you are intentionally moving those services too. Before saving, compare the proposed zone with the backup and confirm that only the intended web records changed.

Check for a conflicting AAAA record

An AAAA record sends IPv6 visitors to an IPv6 address. If an old AAAA record points to another server, IPv6-capable visitors can reach the wrong site even while IPv4 tests look correct. Remove or update an obsolete AAAA record, or configure the VPS with the correct IPv6 address and web server support. Do not add an AAAA record merely because the provider offers the field; it must identify the same service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wait for DNS and verify it independently

Do not troubleshoot WordPress while DNS is still returning an old destination. From a workstation, run:

dig example.com +short
dig www.example.com +short

The apex query should return the VPS IPv4 address. The www query may show the CNAME target or, depending on the resolver, the final address after following the chain. Query from a second network, such as a mobile connection, if local caching makes the result unclear.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

If the result is old, first confirm that you edited the authoritative DNS host and that the record name was entered correctly. Then allow the prior TTL and any nameserver propagation period to expire. Repeatedly changing records during this window makes diagnosis harder and can extend the time different visitors see different answers.

Useful verification questions

  • Does the apex resolve to the current VPS address?
  • Does www resolve through the intended CNAME chain?
  • Is an unexpected AAAA record returning an old IPv6 destination?
  • Are the authoritative nameservers the ones where you made the edit?
  • Do MX and mail-related records still return the same values as before?

Configure Nginx or Apache for both hostnames

Once DNS reaches the VPS, configure the web server. DNS only delivers the request to an IP address; the server still needs to know which site to serve.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nginx server block

Create or edit the site’s server block so its host list contains both the apex and www names, its root points to the WordPress document root, and PHP requests are passed to the PHP-FPM socket used by that VPS image. A conceptual structure is:

server {
    listen 80;
    server_name example.com www.example.com;
    root /var/www/example;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ .php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
}

The document-root path and PHP-FPM socket in this example are installation-specific. Use the values supplied by the operating system or VPS image rather than copying them blindly. Enable the site, validate the Nginx configuration with the distribution’s test command, and reload Nginx only after the test succeeds.

Apache virtual host

For Apache, create or edit a virtual host with ServerName example.com and ServerAlias www.example.com. Set its DocumentRoot to the WordPress directory, ensure the rewrite module and PHP handler used by the installation are enabled, check the configuration, then reload Apache. The exact file path, service name and PHP integration differ by distribution.

Do not configure only one hostname. If www is absent from the host list, a request can fall through to the default site even though its DNS record is correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Set WordPress’s canonical URL

Choose one public form as canonical: either https://example.com or https://www.example.com. Both forms can resolve, but WordPress should generate links and redirects consistently from one of them.

  1. Open the WordPress administration area and go to Settings > General.
  2. Set WordPress Address (URL) and Site Address (URL) to the same final HTTPS hostname.
  3. Save the settings only after the intended hostname resolves and the web server serves the correct installation.

Some installations define these values in configuration rather than allowing the dashboard to edit them. In that case, use the hosting provider’s documented configuration method. If a URL change makes the site inaccessible, restore the previous values through the database or configuration file using the provider’s recovery procedure. There is no single safe command for every Linux distribution, control panel and WordPress layout.

Keep the alternate hostname in the web-server configuration and certificate even if it will redirect to the canonical form. That lets visitors who type the other version reach the site cleanly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Issue HTTPS after DNS works

Request a certificate only after both hostnames resolve to this VPS and the web server answers them. Obtain a Let’s Encrypt certificate or another trusted certificate covering the canonical hostname and its alternate. Certificate authorities commonly validate control through HTTP or DNS; an unresolved hostname or blocked validation port will cause issuance to fail.

  1. Confirm that dig returns the VPS for the apex and www.
  2. Allow inbound TCP 80 and 443 through the provider firewall, security group and VPS firewall.
  3. Request a certificate containing every hostname visitors may use, normally the apex and www.
  4. Install the certificate and the complete certificate chain in the TLS server block. Nginx requires the chain to be presented correctly so clients can build trust.
  5. Reload the web server after validating its configuration.
  6. Configure an HTTP-to-HTTPS redirect, leaving the HTTPS virtual host serving the WordPress files.

Do not force HTTPS in WordPress before the certificate and TLS server block are working. Otherwise visitors can be redirected to a connection that cannot complete.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the finished connection

Test from a normal browser and, where possible, from another network. Check every combination rather than only the URL you normally type.

  • http://example.com reaches the intended site or redirects to the canonical HTTPS URL.
  • http://www.example.com behaves the same way.
  • https://example.com presents a valid certificate and the chosen canonical behavior.
  • https://www.example.com presents a valid certificate and redirects or serves according to your choice.
  • The WordPress dashboard, login, media library and uploaded images load without mixed-content warnings.
  • Internal links, canonical tags and generated feeds use the chosen hostname.
  • Email sending and receiving still work, and unrelated subdomains resolve as before.

If only some visitors see the old site, do not immediately replace the records again. DNS resolvers may still hold the former answer until its TTL expires.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot by symptom

Symptom Likely layer What to check
dig returns the old IP address DNS or cache Verify the authoritative host, record name and TTL. Check for an old AAAA record and wait for cached answers to expire.
The apex works but www fails DNS, web-server host list or certificate coverage Confirm the www CNAME, include both names in the server block or virtual host, and include both names on the certificate.
The default Nginx or Apache page appears Web-server routing DNS has reached the VPS, but no matching hostname configuration is active. Check server_name or ServerName, the enabled-site link and the reload result.
HTTPS certificate issuance fails DNS, firewall or certificate authorization Confirm both DNS answers, open ports 80 and 443, remove conflicting AAAA records and inspect any restrictive CAA record.
WordPress redirects in a loop Canonical URL or proxy TLS settings Ensure both WordPress URL fields use the same HTTPS hostname and that the web server’s HTTPS detection and redirect rules agree.
Email stops after the web change DNS zone Restore MX, DKIM, SPF, DMARC and related records from the backup. Do not replace the zone with only web records.
Images or scripts show mixed-content warnings WordPress URLs or hard-coded links Check the site and WordPress addresses, update absolute HTTP references using a controlled migration method, and clear relevant caches.

Nameserver, DNS and canonical-domain decisions

When a nameserver move is reasonable

Use a nameserver change when the domain has no important existing services or when you are deliberately moving the complete DNS zone. It can simplify management if the new provider integrates certificate issuance and VPS automation. Recreate every required record before switching delegation, then compare the new zone with the backup.

When individual record edits are safer

Keep the current nameservers when email, a shop, an application or many subdomains already depend on them. Changing only the apex A record and www CNAME limits the blast radius and preserves those services.

Apex versus www as the canonical form

Neither form is technically superior for WordPress. The important requirement is consistency. Pick the form that matches your branding and existing links, configure both names in the web server, cover both names with TLS, and redirect the alternate form to the canonical one.

Provider-managed DNS versus registrar DNS

Provider-managed DNS can offer integrated automation, while registrar-hosted DNS keeps the records with the company that already manages the domain. The deciding question is not the label on the dashboard; it is which nameservers are authoritative and whether the service gives you reliable backups, record history and access to all required record types.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checks after the migration

Keep the DNS backup and a note of the VPS address, canonical URL, certificate names and web-server configuration location. Review the zone after any hosting change, especially if the VPS address can change. Renew certificates before expiration, monitor both apex and www endpoints, and test mail after major DNS edits.

If the VPS is replaced, update the A record only after the new server is ready to answer the hostname. If IPv6 is introduced later, add an AAAA record only when the new server, firewall and web-server configuration are prepared for IPv6 traffic. A DNS answer that reaches an unconfigured address is equivalent to pointing at the wrong server.

Complete sequence at a glance

  1. Reserve a stable public VPS address.
  2. Confirm WordPress, PHP, the database and Nginx or Apache work locally on the VPS.
  3. Back up the authoritative DNS zone.
  4. Choose nameserver delegation or individual record editing based on existing services.
  5. Add the apex A record and www CNAME, preserving MX and unrelated records.
  6. Remove or correct any obsolete AAAA record.
  7. Verify both names with dig and wait for propagation.
  8. Configure the Nginx server block or Apache virtual host for both names.
  9. Set matching WordPress Address and Site Address values for the final canonical HTTPS URL.
  10. Issue and install a certificate covering the canonical and alternate hostnames.
  11. Redirect HTTP to HTTPS and test every hostname, WordPress function and mail service.

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.

ApacheDNSdomain namesHTTPSNGINXVPSWordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.