Skip to content
Shopify tutorials

How to connect a domain to Shopify (and fix DNS errors)

You bought a domain from GoDaddy, Namecheap, Cloudflare or another registrar, and now you want your Shopify store to open on yourbrand.com instead of yourstore.myshopify.com. Shopify makes this possible, but the DNS part trips up a lot of store owners: a wrong A record, an old AAAA record or a Cloudflare proxy is enough to keep the domain stuck on “Needs attention” or “SSL pending”.

In this tutorial, we will learn how to connect a domain to Shopify step by step, which DNS records you need to add at your domain provider, how to check that the records are correct, and how to fix the most common Shopify domain errors.

Previously, I published a tutorial on how to remove the password page and launch your Shopify store. Connecting your own domain is usually the last step before launch, so if your store is still password-protected, you can do both today.

Before you start

Make sure you have the following ready:

  • A Shopify store (if you haven’t built one yet, the domain can wait until your products and pages are ready).
  • Login access to the account where your domain is registered, or wherever its DNS is hosted (for example Cloudflare).
  • Staff permission to manage domains in Shopify, if you are not the store owner.

If you don’t own a domain yet, you can also buy one directly from Settings > Domains > Buy new domain. A domain bought from Shopify is configured automatically, so you can skip the DNS steps below. This guide focuses on third-party domains, which is where most connection problems happen.

Step 1: Open Settings > Domains

Log in to your Shopify admin and go to Settings > Domains. You will see your default .myshopify.com domain listed as the primary domain for your online store.

Click Connect existing domain.

shopify-settings-domains

Step 2: How to connect your domain to Shopify

Enter your root domain, for example example.com. Don’t type www. or any other subdomain here, because Shopify will handle the www version for you through the CNAME record.

Click Next. Shopify checks where your domain is registered. For some providers, Shopify may offer to connect the domain for you after you sign in to the provider. If you see that option, follow the prompts and you’re done. Otherwise, continue with the manual setup and click Connect domain after you have updated the DNS records in the next step.

shopify-connect-existing-domain

Step 3: Update the DNS records at your domain provider

Now log in to your domain provider (or your DNS host, if your nameservers point somewhere else) and open the DNS management page for your domain. You need to set these three records:

Type Host / Name Value / Points to
A @ 23.227.38.65
AAAA @ 2620:0127:f00f:5::
CNAME www shops.myshopify.com.

Here is the same configuration in zone-file format, in case your provider lets you edit DNS as text:

@     IN  A      23.227.38.65
@     IN  AAAA   2620:0127:f00f:5::
www   IN  CNAME  shops.myshopify.com.

A few rules that matter a lot here:

  • Only one A record and one AAAA record for the root domain. Delete any other A or AAAA records on @, for example the ones your registrar created for its parking page or website builder.
  • If your provider rejects the short IPv6 format, use the expanded version: 2620:0127:f00f:0005:0000:0000:0000:0000.
  • Keep the trailing period in shops.myshopify.com. if your provider accepts it. Some providers add it automatically.
  • Leave the TTL at the default value.
  • If you use Cloudflare, set the Shopify records to DNS only (grey cloud). Shopify doesn’t support the Cloudflare proxy.
  • Don’t touch your MX records. They control your email and have nothing to do with the store.

Save the records, go back to Shopify and click Connect domain.

Step 4: Check the DNS records and wait for SSL

DNS changes are not instant. According to Shopify, it can take up to 48 hours for your domain to be fully live, although in practice it is often much faster. You can follow the status in Settings > Domains, where Shopify shows whether DNS points to Shopify, whether the domain is live and whether the SSL (TLS) certificate has been provisioned.

If you are comfortable with the command line, you can check the records yourself with dig (macOS/Linux) instead of waiting:

dig +short example.com A
dig +short example.com AAAA
dig +short www.example.com CNAME

The correct output should look like this:

shopify-domain-dns-check

On Windows you can use nslookup example.com, or use an online checker such as whatsmydns.net or dnschecker.org to see how the records look from different locations.

You don’t need to buy an SSL certificate. Once DNS is correct, Shopify issues a free certificate automatically. While that happens, you may see SSL pending or TLS pending in the admin for a while.

Step 5: Set your new domain as the primary domain

When the domain is connected, you probably want customers to always land on it. Go back to Settings > Domains, click Change primary domain, select your new domain (most stores pick either example.com or www.example.com) and save.

Visitors who open your .myshopify.com address or the other version of your domain are redirected to the primary domain, which is also better for SEO because Google only sees one version of your store.

If you later rename your brand, read how to change your Shopify store name. The store name and the domain are separate settings, so changing one doesn’t change the other.

Common errors when connecting a domain to Shopify

If the domain shows a Needs attention badge, Shopify usually tells you exactly which record is wrong. These are the messages you are most likely to see, and how to fix them:

“Your domain’s A record doesn’t point to Shopify”

Edit the A record on @ and set it to 23.227.38.65. Make sure you edited the record at the provider that actually hosts your DNS. If your nameservers point to Cloudflare, changes made at the registrar have no effect.

“Your domain has too many A records” / “too many AAAA records”

Your registrar often keeps its own A and AAAA records for a parking page. Delete every A and AAAA record on the root domain except the Shopify ones. This is the most common reason a domain loads the old parking page on some devices and Shopify on others.

“Your domain’s CNAME record doesn’t point to Shopify” or “Your domain has no CNAME record”

Add or edit the www CNAME so it points to shops.myshopify.com.. Some people point it to yourstore.myshopify.com; Shopify’s documentation asks for shops.myshopify.com, so use that value.

“Your domain is using a Cloudflare Proxy, which Shopify does not support”

In Cloudflare, open DNS > Records and switch every record that points to Shopify from Proxied (orange cloud) to DNS only (grey cloud).

SSL pending for more than 48 hours

Check three things: the A, AAAA and CNAME values above, any CAA records (they must allow letsencrypt.org, pki.goog and ssl.com, or be removed), and DNSSEC. Shopify’s troubleshooting guide recommends turning DNSSEC off at your provider if it is misconfigured. If you have a wildcard record such as *.example.com pointing to Shopify, replace it with specific subdomain records.

“Sorry, this store does not exist”

If your domain shows this Shopify error page, DNS already points to Shopify but the domain isn’t connected to a store (or it was removed from one). Finish Step 2 in the correct store, or follow my guide to fix the Shopify “Sorry, this store does not exist” error.

Domain already connected to another Shopify store

If you are moving a domain from an old store to a new one, Shopify asks you to verify that you own it before it can be transferred. Follow the instructions in the admin, or remove the domain from the old store first if you still have access to it.

For the full list of messages, see the official Shopify Help Center guide to connecting a third-party domain manually.

Wrapping up

Connecting a domain to Shopify comes down to three DNS records: an A record to 23.227.38.65, an AAAA record to 2620:0127:f00f:5:: and a www CNAME to shops.myshopify.com.. Remove any conflicting records, turn off the Cloudflare proxy if you use it, give DNS some time, then set your new domain as the primary domain.

If your domain is still stuck on “Needs attention” or “SSL pending”, leave a comment below with your domain provider and the exact error message, and I’ll try to help you out.

Written by

Hung Tran

Hung Tran is the main editor of magentip.com, he loves to write about everything related to Magento 2