October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

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

A practical, layer-by-layer guide to pointing a domain at a WordPress VPS, preserving email and subdomains, configuring the web server, setting the canonical URL, and enabling HTTPS.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To connect a domain to a WordPress site on a VPS, point the domain’s DNS to the VPS’s stable public IP, configure the VPS web server to recognize both the root and www hostnames, set WordPress’s canonical URL, then issue a TLS certificate and redirect HTTP to HTTPS. DNS only gets a request to the server; Nginx or Apache must still select the correct WordPress site.

The sequence matters. Back up the existing DNS zone, preserve mail and other services, verify DNS with dig, configure the virtual host, and only then request HTTPS. This guide assumes WordPress, PHP, a database, and a web server are already installed on a Linux VPS.

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.

What “connecting a domain” actually changes

A domain connection has two separate layers:

  • DNS: records tell resolvers which IP address or hostname belongs to a domain. An apex A record sends example.com to the VPS IPv4 address; a www CNAME can point www.example.com to the apex.
  • Web-server hosting: Nginx or Apache receives the request and chooses a site configuration based on the requested hostname. That configuration must point to the WordPress document root and pass PHP requests to PHP-FPM.

Changing DNS without configuring the server can produce a default Nginx page, an Apache placeholder, or the wrong site. Configuring a server block without DNS leaves the public domain pointing somewhere else.

Check the prerequisites before editing DNS

Use a stable public address

Find the VPS’s public IPv4 address in the hosting control panel or with the provider’s documented method. It must be reachable from the internet and must not be an ephemeral address that changes after a stop, restart, or rebuild. If the provider offers an Elastic IP, reserved IP, or equivalent static allocation, attach it before changing DNS. WordPress developer guidance specifically describes assigning an Elastic IP when an instance address can change.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Record the address you intend to publish. The illustrative address 203.0.113.10 used later is documentation-only; replace it with the actual public address assigned to your VPS.

Confirm the software already exists

This procedure assumes that WordPress files, a database, PHP, and either Nginx or Apache are installed. You also need administrative access to the VPS, access to the authoritative DNS host, and permission to open TCP ports 80 and 443 in the VPS firewall or provider security group.

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

Choose the final hostname

Decide whether the canonical site will be the apex form (https://example.com) or the www form (https://www.example.com). Both can work. Pick one for WordPress and redirects, while keeping the other available as an alternate that redirects to it.

Back up the current DNS zone

Before touching a record, sign in to the registrar or DNS provider that is authoritative for the domain and export or copy every existing record. WordPress’s official guidance recommends this backup because a web-only change can accidentally remove email, shop, application, verification, or other subdomain records.

Keep at least the following in the backup:

  • MX records and any mail-related A, CNAME, TXT, or SPF records.
  • DKIM and DMARC TXT records.
  • Existing subdomains such as shop, app, api, or staging hosts.
  • CAA, verification, and service-discovery records.
  • Any existing AAAA records, noting which server each one reaches.

Do not replace the entire zone with only the two web records. DNS providers differ in how they display the zone, so save a screenshot or export as well as a text copy when possible.

Choose between changing nameservers and editing records

Nameservers determine which service hosts the domain’s entire DNS zone. Individual records change only the entries needed for the website.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach Use it when Main consequence
Change nameservers The domain is used only for this website, or you are deliberately moving all DNS management to another provider. The new provider becomes authoritative for mail, subdomains, verification records, and every other DNS entry; recreate them before switching.
Edit A and CNAME records Email, a shop, an app, or other subdomains must remain with their current services. The existing DNS provider stays authoritative, and only the website hostnames change.

WordPress documentation describes both choices and recommends editing individual records when existing services must continue without interruption. If you do delegate nameservers, copy the complete zone to the new provider first and check MX and TXT records before updating the registrar.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Add the DNS records for the VPS

Use an apex A record

At the authoritative DNS host, create or edit an A record whose name is the provider’s representation of the apex: commonly @, an empty name, or the bare domain. Set its value to the VPS’s public IPv4 address.

Point www with a CNAME

Create a CNAME named www that points to the apex domain, such as example.com. Some DNS interfaces automatically append the domain; follow that interface’s format. If your provider supplies different target values, use those exact values.

Type Name Value TTL
A @ 203.0.113.10 3600 seconds in this illustrative configuration
CNAME www example.com 3600 seconds in this illustrative configuration

The 3600-second TTL is an example used by Nxeon’s 2026 VPS configuration guidance, not a universal requirement. A lower TTL can make a planned migration easier; a higher TTL reduces repeated lookups. The effective delay is controlled by cached TTLs and provider behavior, so changing TTL after a record has already been cached cannot instantly flush old answers.

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

Check for an interfering AAAA record

An AAAA record sends IPv6 clients to a different destination. If that server is not the same VPS, remove the obsolete AAAA record or replace it with the VPS’s correct IPv6 address after confirming IPv6 is configured. Leaving a stale AAAA record can make the site work for some visitors and fail for others because IPv6-capable clients may prefer it over IPv4.

Leave unrelated records intact

Do not delete MX, mail, shop, app, API, TXT, CAA, or unrelated subdomain records. A DNS change for the website should not alter email delivery or another service’s hostname.

Wait for DNS and verify it from outside the VPS

After saving the records, query them from a workstation or another network. Use:

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

The apex query should return the VPS address. The www query may show the CNAME target and then the resulting address, depending on the resolver and command output. Continue when both names resolve to the intended VPS or CNAME chain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Nameserver changes can take up to 72 hours according to WordPress.com Support’s 2026 guidance. Record edits often appear sooner, but local resolver caches, ISP caches, and the previous TTL still apply. If one network sees the new address and another sees the old one, that is normally propagation rather than a WordPress fault.

Interpret common dig results

  • Correct VPS address: DNS is reaching the intended server; move on to the web-server configuration.
  • Old address: confirm you edited the authoritative DNS host, then wait for cached TTLs to expire.
  • No answer: check the record name, spelling, zone, and whether the nameserver delegation is actually using this provider.
  • Unexpected IPv6 result: inspect and correct the AAAA record before testing HTTPS.

Configure Nginx or Apache for both hostnames

Once DNS reaches the VPS, configure the installed web server. The exact file path, service name, PHP-FPM socket, and reload command depend on the Linux distribution and VPS image, so use the image provider’s instructions rather than treating one command as universal.

Nginx server block requirements

The server block must include both names in its server_name directive, point root to the WordPress document root, provide the normal WordPress front-controller fallback, and pass PHP files to the installed PHP-FPM service. A conceptual block looks like this:

server {
    listen 80;
    server_name example.com www.example.com;
    root /path/to/wordpress;
    index index.php index.html;

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

    location ~ .php$ {
        # Use the PHP-FPM socket or upstream supplied by your VPS image.
    }
}

The path and PHP-FPM endpoint above are examples of the settings that must exist, not distribution-independent commands. Test the configuration with the operating system’s Nginx validation command and reload only after it reports valid syntax.

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.

Apache virtual host requirements

For Apache, create or edit the virtual host so ServerName is the chosen canonical hostname and ServerAlias includes the alternate hostname. Set DocumentRoot to the WordPress directory, enable the required rewrite and PHP modules, and use the PHP handler supported by the VPS image. Validate the configuration before reloading Apache.

In either server, a request for the domain must select this site rather than the default virtual host. If the default page appears, DNS is probably working but the hostname does not match the intended server block or virtual host.

Set WordPress’s canonical URL

In the WordPress administration area, open Settings > General and set both WordPress Address (URL) and Site Address (URL) to the same final hostname. Use the HTTPS form after the certificate is installed, for example https://example.com or https://www.example.com. Do not leave one field on the apex and the other on www.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

These values control generated links, redirects, feeds, media URLs, and login behavior. The alternate hostname should be handled by the web server with a redirect to the canonical one, not by maintaining two independent WordPress URLs.

If changing the URL locks you out

A mistyped hostname or premature HTTPS value can make the dashboard inaccessible. Restore the previous values through the database or the WordPress configuration file using the recovery procedure documented for your hosting image. Exact commands vary by distribution, database setup, and installation method, so do not run a command copied from an unrelated VPS without checking its paths and credentials.

Issue and install HTTPS only after DNS works

Request a Let’s Encrypt certificate or another certificate from a trusted certificate authority after both hostnames resolve to the VPS and the web server answers them. The certificate should cover the hostname you chose as canonical and its alternate, whether that means the apex plus www or the reverse.

Certificate validation normally requires the authority to reach the site over the public internet. Confirm that the VPS firewall and any provider security group allow TCP ports 80 and 443. Check for conflicting CAA records and an incorrect AAAA record if issuance fails.

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

Install the certificate and the complete certificate chain in the TLS server configuration. Nginx documentation specifically notes that the full chain must be sent, not merely the leaf certificate. Configure the HTTP virtual host to redirect to the HTTPS canonical hostname, and configure the HTTPS host to serve WordPress.

After enabling TLS, update both WordPress URL fields to the final HTTPS value if you have not already done so. Redirecting before the certificate is valid can create a loop or an unreachable site; issuing the certificate before DNS reaches the VPS can fail domain validation.

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

Test the finished connection

  1. Open the apex over HTTP and HTTPS.
  2. Open www over HTTP and HTTPS.
  3. Confirm the non-canonical hostname redirects once to the chosen HTTPS canonical URL.
  4. Confirm the canonical page loads WordPress content rather than a default server page.
  5. Sign in to the dashboard and open several media URLs.
  6. Inspect the browser for mixed-content warnings, especially images, scripts, stylesheets, and embedded media still using HTTP.
  7. Send and receive a test email to confirm that MX and related records were preserved.
  8. Repeat the DNS checks from a second network if some visitors still report the old site.

A successful browser result alone is not enough: it may be coming from a cached DNS answer. Compare the hostname answers with dig and test both IPv4 and IPv6 paths when the domain publishes both address families.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Choose a canonical hostname: apex or www

Choice Configuration needed Operational note
Apex canonical A record for @; www CNAME; both names in the web server and certificate; redirect www to the apex. Visitors see the shorter bare domain.
www canonical A record for @; www CNAME; both names in the web server and certificate; redirect the apex to www. The explicit web subdomain can be useful when other services occupy subdomains.

The important requirement is consistency. DNS, the virtual host, TLS certificate, WordPress URL settings, and redirects must all agree on which hostname is canonical.

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

Nginx versus Apache and where DNS is managed

Use the web server already installed and supported by the VPS image. Nginx and Apache implement the same hostname and TLS concepts: match both names, serve the WordPress root, process PHP, and redirect the alternate hostname. Replacing the web server solely to connect a domain adds migration risk without changing the DNS steps.

Provider-managed DNS can integrate with VPS automation and certificate tools. Registrar-managed DNS keeps the zone in one familiar account. Neither changes the required A, CNAME, preservation, propagation, or verification steps. The authoritative nameservers, not the company where the domain was purchased, determine where records must be edited.

Troubleshoot by symptom

dig still returns the old address

Check the authoritative nameservers first; you may have edited a non-authoritative dashboard. If the nameservers are correct, wait for the previous TTL and broader propagation window. Do not repeatedly change records while caches are still expiring, because each change makes diagnosis harder.

The apex works but www fails

Confirm that a www CNAME exists and points to the intended apex. Then confirm that both names appear in the Nginx server_name or Apache ServerAlias, and that the certificate includes both names.

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.

A default Nginx or Apache page appears

DNS is reaching the VPS, but the requested hostname is selecting the default virtual host. Check spelling, enabled-site links, server-block order, and the document root. Reload the server only after its configuration validation succeeds.

HTTPS certificate issuance fails

Run dig for both names, check that ports 80 and 443 are reachable from the internet, inspect firewall and security-group rules, and look for conflicting CAA or AAAA records. A certificate authority cannot validate a hostname that resolves to another server or is blocked on the validation path.

Email stopped after the web change

Compare the live zone with the backup. Restore MX, DKIM, SPF, DMARC, and any mail-related A or CNAME records that were removed. Do not solve a website problem by replacing the whole zone with only the A and CNAME records.

Only some visitors see the old site

Different recursive resolvers may still hold the previous answer. Check the TTL and wait for caches to expire before changing the records again. If the split persists beyond the expected window, verify delegation and inspect both A and AAAA responses.

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

End-to-end change checklist

  • Reserve a stable public VPS address.
  • Confirm WordPress, PHP, the database, and Nginx or Apache are installed.
  • Export the current DNS zone.
  • Decide whether to delegate nameservers or edit only web records.
  • Create the apex A record for the VPS IPv4 address.
  • Create the www CNAME and inspect for stale AAAA data.
  • Preserve mail, shop, app, verification, and unrelated subdomain records.
  • Verify both names with dig.
  • Configure the web server for both hostnames and the WordPress document root.
  • Set WordPress Address and Site Address to one chosen canonical hostname.
  • Issue a certificate covering the canonical and alternate names.
  • Install the full certificate chain and redirect HTTP to HTTPS.
  • Test both hostnames, both protocols, the dashboard, media, mixed content, and email.

Following that order keeps DNS, the VPS web server, WordPress, and TLS aligned. When a failure occurs, identify which layer is failing before changing another one.

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.

Leave a Reply

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

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
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.