Skip to content

How to Set Up DNS and HTTPS for WordPress

A clear guide to the DNS records and HTTPS settings behind a WordPress site: A, AAAA, CNAME and CAA records, certificates, redirects, mixed content and checks after launch.

10 min readUpdated Nov 27, 2026By XPASS Editorial Team

How to Set Up DNS and HTTPS for WordPress

A WordPress site depends on two systems that you rarely see until something breaks. DNS decides which server a visitor reaches when they type your domain. HTTPS decides whether the connection to that server is encrypted and whether the browser trusts it. Most launch problems, such as a site that opens for you but not for a colleague, a padlock warning or an email that stops arriving, come from a mismatch between these two layers and the WordPress settings that sit on top of them.

This guide explains what to set in DNS, how to get a certificate working, how to make WordPress use the secure address everywhere, and how to check the result. It is written for owners and small teams who manage their own domain, with or without a developer. Where details differ between hosts, follow the instructions in your hosting account and use this guide to understand why each step matters.

How the pieces fit together

When someone types your domain, their device asks a resolver to look up the records in your domain's DNS zone, a process described in RFC 1034 and RFC 1035. The resolver gets an IP address, the browser connects to it, and then HTTPS begins: the server presents a certificate, the browser checks that it matches the domain and is trusted, and encrypted traffic starts. Finally WordPress builds the page and uses its configured address in every link.

So there are three places where the address must agree:

  1. DNS records that send the domain to the right server.
  2. The certificate that names your domain (and www) and is installed on that server.
  3. WordPress settings that use the https address and the same main version.

When you plan a change, work through them in that order.

The DNS records a WordPress site uses

Different records do different jobs. This table lists those you will meet.

Record Purpose Typical use for WordPress
A Maps a name to an IPv4 address The bare domain pointing at the web server
AAAA Maps a name to an IPv6 address Only if your host supplies an IPv6 address
CNAME Makes one name an alias of another www pointing to the bare domain or to a host-supplied name
MX Says where email for the domain is delivered Keep exactly as your email provider specifies
TXT Holds text used for verification and email authentication SPF, DKIM, DMARC, site verification
CAA Lists which certificate authorities may issue for the domain Optional safeguard; must include the authority your host uses
NS Names the servers that answer for the zone Changed only when moving DNS to another provider

The TTL, or time to live, on each record controls how long resolvers may remember an answer. A low TTL means changes spread faster, and a high TTL means fewer lookups but slower changes.

Step 1: Plan before you touch anything

Preparation turns a risky change into a routine one.

  1. Find where DNS is managed. Look at the nameservers listed for the domain. DNS changes only matter at the provider that runs those nameservers.
  2. Export or screenshot all current records. Pay special attention to MX and TXT records.
  3. Get the target from your host. This is normally an IP address, and sometimes a hostname for www. Ask whether the host also supports IPv6.
  4. Lower the TTL in advance. If the current records have a long TTL, reduce it to a few minutes a day before the change, then raise it again afterwards.
  5. Choose the main address. Decide between the bare domain and www, and write it down.
  6. Back up the site. Settings and links in WordPress may change later in this process.

Step 2: Create or correct the records

Open the DNS zone and make the following changes.

  1. For the bare domain, set the A record to the IP address of your WordPress server. Remove any older A records for the same name that point elsewhere.
  2. If the host has given an IPv6 address, add an AAAA record for the same name. If it has not, delete any stale AAAA record, because a wrong one sends IPv6 visitors to the wrong place.
  3. For www, add a CNAME to the bare domain, or to the name your host specifies. Some hosts instead want an A record for www.
  4. Leave MX and email-related TXT records untouched.
  5. If you use a CAA record, make sure it lists the certificate authority your host will use. If you are not sure, remove the CAA record temporarily or ask the host.
  6. Save the changes and wait for them to spread.

Then check what the public sees by using an online DNS lookup tool or the dig command on a computer. Confirm that the bare domain and www both return the values you expect. Do not move on to HTTPS until they do.

Step 3: Get HTTPS working

A certificate is issued by a certificate authority after it checks that you control the domain. Many hosts automate the process through the ACME protocol defined in RFC 8555, and services such as Let's Encrypt explain the idea on their How It Works page. You can also install a certificate you bought separately.

Automatic certificates from the host

Look for an option in the hosting panel such as SSL, Security or Let's Encrypt, and request a certificate for both the bare domain and www. The authority checks control, usually by requesting a small file from your site or by reading a DNS record. This is why DNS must already point to the server. If issuance fails, the usual reasons are:

  • the A or AAAA record still points to another server;
  • the www name has no record;
  • a CAA record does not allow the authority;
  • a firewall, a security plugin or a password-protection setting blocks the validation request;
  • the domain was added to the hosting account under a different name.

Certificates you install yourself

You generate a certificate signing request on the server, give it to the authority, and install the issued certificate with its chain. Make sure the certificate lists every name you use. A wildcard certificate covers many subdomains of one level, and a single-name certificate covers only the names it lists. Certificates follow the X.509 profile; the chain must be complete or some devices will warn.

Renewal

Certificates expire. Automatic ones renew on a schedule, but renewal can silently fail if DNS, the web server or a security rule changes. Put the expiry date in a calendar, and check once after any major change.

Step 4: Make WordPress use the secure address

HTTPS at the server does not fix links stored inside WordPress.

  1. In Settings, General, set both the WordPress Address and the Site Address to the https version of your main address. Save, and sign in again if asked.
  2. Redirect HTTP to HTTPS in one place only, either in the host's settings or in the web server configuration or a trusted plugin. Duplicated redirects are a common cause of loops.
  3. Redirect the non-main name (www or bare) to the main one.
  4. Update stored links. Old posts, widgets, menus and theme options may still contain http addresses. Use a search-and-replace tool carefully, on a backup, because some WordPress data is serialized and careless edits can corrupt it.
  5. Check the theme and plugins for hard-coded http links, including fonts, analytics scripts and embedded media.
  6. If your site sits behind a CDN or proxy that terminates HTTPS, make sure WordPress knows the original request was secure, otherwise it may redirect in a loop. Your host or CDN documentation describes the required setting.

A note on HSTS

HTTP Strict Transport Security tells browsers to insist on HTTPS for your domain for a period of time. It is useful, but it can lock visitors out if the certificate later fails, so enable it only after HTTPS has been stable for some time and start with a short duration.

Step 5: Verify like a visitor

After the changes, test from outside your usual environment.

  • Open http and https versions of the bare domain and www on your phone using mobile data.
  • Confirm that each ends on the single main address.
  • Click the padlock and check that the certificate names your domain and has not expired.
  • Open several page types: home, a post, an image-heavy page, the login page, a form.
  • Look for mixed content warnings in the browser's developer tools.
  • Send test email in both directions if you use business email on the domain.
  • Check the site on at least one mobile network, since some problems come from IPv6 or resolver differences.

A plain example

Mei runs a small bakery blog on WordPress at mybakery.example. The host gave her the server's IPv4 address and said it also supports IPv6. She does the following.

  1. She notes the current DNS records, including MX and TXT records for her email, and lowers the TTL to five minutes the day before.
  2. She changes the A record for the bare domain to the new IPv4 address and adds an AAAA record with the IPv6 address.
  3. She sets the www CNAME to the bare domain.
  4. She checks with a lookup tool that both names return the right answers.
  5. In the hosting panel she requests a certificate for both names. It is issued within minutes.
  6. In WordPress she changes both addresses to https, turns on the redirect from HTTP at the host, and runs a search-and-replace on a backup copy before applying it to the live database.
  7. She checks the padlock, loads her biggest post, finds one image still on http, fixes it, and sends herself a test email.

The same logic applies to shops and other platforms, and each has its own details. If your site sells through WordPress, see the guide to DNS and HTTPS for WooCommerce, and if you are comparing hosted builders you can read how the process works for Shopify and Wix.

Limits and what to watch for

  • Propagation takes time. Do not keep changing records while you wait, as that restarts the problem you are trying to measure.
  • Never delete MX or email TXT records during cleanup. Losing them stops mail or weakens its authentication.
  • Stale AAAA records are an easy mistake. If IPv6 visitors see an old server or an error, check them first.
  • CAA records can block issuance. If you add one, include every authority you may use.
  • Redirect loops come from duplicated redirects or from a proxy that hides the original protocol. Keep the redirect in one place.
  • A certificate proves identity of the domain and encrypts the connection. It does not make the website itself secure or free of vulnerabilities. Keep WordPress, themes and plugins updated.
  • Shared hosting may limit what you can change. Some hosts manage certificates and redirects for you. Read their notes before adding your own.
  • Domain renewal matters as much as the certificate. An expired domain stops everything, whatever the DNS looks like.
  • Document the setup. Write down where DNS is managed, who has access and when things renew.

Summary

Setting up DNS and HTTPS for WordPress is a matter of making three layers agree. In DNS, point the bare domain and www to the right server with A, AAAA and CNAME records, keep MX and TXT records for email, and consider a CAA record. Get a certificate that covers both names, make sure it renews, then set the WordPress Address and Site Address to https, keep one redirect in one place and clean up mixed content. Check the result from outside your own network and write down who manages what.

If you need a domain to start with, the options are on the domains page.

Frequently asked questions

Which DNS records does a WordPress site need?

At minimum, an A record (and an AAAA record if the host gives an IPv6 address) for the bare domain, and a CNAME or A record for www. If you use business email you also keep MX and TXT records, and some owners add a CAA record to limit which certificate authorities may issue certificates for the domain.

Why does the HTTPS certificate fail to issue even though my site loads?

Most automatic issuance checks that the domain points to the server that is asking for the certificate. Old A or AAAA records, a missing www record, a CAA record that does not list the authority, or a firewall that blocks the validation request are the usual reasons.

What is mixed content and how do I fix it?

Mixed content means a page loaded over HTTPS still requests images, scripts or styles over plain HTTP, so the browser warns or blocks them. Update stored links to the https address, check theme and plugin settings, and use a safe search-and-replace on a backup.

Should I force HTTPS and which version of the address should be main?

Yes, once a valid certificate is installed. Redirect HTTP to HTTPS and choose either the bare domain or the www name as the main address, then redirect the other to it, so each page has one address.

How long before DNS changes take effect for WordPress?

Usually minutes to a few hours, depending on the TTL of the old records and on caching by resolvers. Lowering the TTL a day before a planned change shortens the wait.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Ready to register your domain?

Search a name, compare extensions and pay once for the years you choose.

.com registration from $18.81 for the first year

Search domains

Keep reading

Domain & DNS Guides

How to Set Up DNS and HTTPS for WooCommerce

What DNS records a WooCommerce shop needs, how to get and renew an HTTPS certificate, and how to avoid redirect loops, mixed content and broken checkout pages.

10 min read

Domain & DNS Guides

How to Set Up DNS and HTTPS for Shopify

What DNS records a Shopify store with your own domain needs, how its HTTPS certificate is issued, and how to fix the usual problems with redirects, CAA and email.

10 min read

Domain & DNS Guides

DNS and HTTPS Setup for Wix: What to Configure

Which DNS records does a Wix site need, and why does the padlock sometimes fail to appear? A practical guide to records, redirects and certificates.

10 min read