Skip to contentTalk to us
Building apps

How to connect a custom domain to your app (DNS without the headache)

A step-by-step guide to connecting a custom domain to your app: DNS record types, www vs root, automatic SSL, keeping email safe and fixing common errors.

Fanann Team8 min read
WhatsApp
ع
Quick answer

To connect a custom domain, add the domain in your app's publishing settings, then copy the records it shows you (usually an A or CNAME record plus a TXT record for verification) into the DNS panel at the company where you bought the domain. Once the records propagate, usually within minutes to hours, an SSL certificate is issued automatically and your site opens over https. Do not delete existing MX records or your email will stop.

People look for this as
  • how to connect a custom domain to my app
  • how to point a domain to my website dns
  • custom domain not working after dns change
  • how long does dns propagation take
  • www or non-www domain which is better

How do you connect a custom domain to your app?

Connecting a custom domain to your app means telling the internet: when someone types yourstore.com, send them to the server that hosts my app. You do that by adding a few records in the DNS panel at the company you bought the domain from; the hosting platform then verifies the connection and issues an SSL certificate automatically.

It looks intimidating because DNS panels are full of acronyms, but in practice you usually need two or three records. The domain stays yours and stays with the same registrar; you do not have to move it anywhere. You are simply writing your app's address into the internet's address book.

If you have not bought a domain yet and are considering a Saudi one, read the guide to .sa domains first. If you are still planning your shop's site, start with a website or app for your shop: where to start.

What is DNS and why should you care?

DNS translates the name people remember into a numeric address machines understand. Every domain has a zone full of records, and each record says one specific thing: where the website lives, where the email goes, who owns the domain. These are the types you will meet:

Record typeWhat it doesTypical use
APoints a name to a numeric IP addressThe root domain yourstore.com
AAAASame as A, for IPv6 addressesOptional, depending on the host
CNAMEPoints one name to another nameThe www or app subdomain
TXTText used for verificationProving domain ownership, email authentication, store verification
MXSays which server handles emailCompany email such as info@yourstore.com
NSSays who manages the whole DNS zoneChanging it moves control of every record

Step-by-step: connecting your domain

  1. 1
    Choose the official version

    Will your site live at yourstore.com or with www in front? Pick one; the other will redirect to it.

  2. 2
    Add the domain in your publishing settings

    In Fanann, open hosting settings and enter the domain. You will see the exact records and values required.

  3. 3
    Open DNS at your registrar

    Sign in where you bought the domain and open DNS management or the zone editor.

  4. 4
    Copy the records exactly

    Add the A record for the root, the CNAME for www and the TXT record for verification if asked. Copy and paste values rather than typing them.

  5. 5
    Remove only conflicts

    If an old A record for the same name points to a previous host, delete it. Leave MX and email records untouched.

  6. 6
    Wait for verification and the certificate

    Once the records are detected, the platform verifies the domain and issues SSL automatically. Open the site over https and test both versions.

www or not? And subdomains

Search engines do not meaningfully prefer either. What matters is choosing one and redirecting the other with a permanent (301) redirect so your content does not appear twice. Many stores choose the version without www because it is shorter in ads, on Snapchat and on Instagram.

Subdomains are handy for separating parts of your project cleanly, and each one is added with its own CNAME record:

  • app.yourstore.com for the web app customers sign in to.
  • admin.yourstore.com for the staff dashboard.
  • staging.yourstore.com for the test copy before release, as explained in staging vs production.
  • ar. or en. only if you prefer separate language hosts; paths such as /ar and /en on one domain are more common today.

Mobile apps benefit too: share links and password-reset links can open the app directly when the domain is connected and declared in the app's settings.

SSL, email and store verification

After connection, an SSL certificate is issued and renewed automatically, so the padlock appears in the browser. Without https most payment gateways and Apple Pay will not work, and customers see warnings that scare them off. For the background, read SSL and HTTPS explained for business owners.

Do not break company email

If your email runs on Google Workspace, Microsoft 365 or another provider, it depends on MX and TXT records (such as SPF and DKIM). Connecting your site never requires touching them. Take a screenshot of every record before you change anything so you can roll back.

Verification with TXT records

Some services ask you to prove domain ownership with a TXT record, including Saudi e-store verification on the Business Platform (formerly Maroof) and search-engine webmaster tools. You can have several TXT records on the same domain without conflict. Details are in verifying your store on the Business Platform.

Domain not working after connecting? Common fixes

SymptomLikely causeFix
The old site still appearsPropagation not finished, or browser cacheWait, then test on mobile data or a private window
'Domain not verified' errorTXT record missing or on the wrong nameMake the record name match exactly what the platform asked for
www works but the root does notMissing A record or one pointing to an old IPAdd or correct the root A record
Browser security warningCertificate not issued yet, or a CDN proxy interferingWait for issuance; pause the proxy temporarily if you use one
Email suddenly stoppedMX records deleted or NS changedRestore the records from your screenshot
'Conflicting records' errorA CNAME on a name that has other recordsA name with a CNAME cannot hold any other record

Propagation can take from minutes to 48 hours depending on TTL settings and internet providers. If two days pass and it still does not work, the problem is almost always a mistyped value, not more waiting.

Checklist before you announce the domain

  • The site opens over https on both versions, and the unofficial one redirects to the official one.
  • Payment return URLs and thank-you pages use the new domain, not the temporary link.
  • OTP messages, automated emails and WhatsApp notifications link to the new domain.
  • Email sends and receives normally after your changes.
  • The domain is registered to you or your company, with auto-renewal on.
  • Your registrar account is protected with two-factor sign-in, because whoever controls it controls your site.
Ready prompt to prepare the connection

Publish my app on the domain yourstore.com, with the version without www as the official one and a permanent redirect from the www version. Give me the exact list of DNS records I need (type, name, value) to add at my registrar, and do not suggest any change to my email MX or TXT records. Add admin.yourstore.com for the dashboard and staging.yourstore.com for the test copy. After verification, enable SSL and make sure payment return links, OTP messages and WhatsApp notifications all use the new domain.

Try it in Fanann

Next step: open the DNS panel at your registrar now, screenshot every existing record, then add the records that Fanann hosting gives you. Within hours your project will live at its real address.

Key takeaways

  • Connecting means adding DNS records at your domain provider, not transferring the domain.
  • The root domain usually uses an A record; a subdomain such as www uses a CNAME.
  • Leave email MX and TXT records alone, or your company email stops working.
  • Propagation can take from minutes up to 48 hours, and the certificate is issued after that.
  • Pick one official version (with or without www) and redirect the other to it.

Frequently asked questions

How do I connect a custom domain to an app I built with AI?
Add the domain in your publishing settings and copy the records it shows (A or CNAME, plus TXT for verification) into the DNS panel at your registrar. After propagation the SSL certificate is issued automatically.
How long does DNS propagation take?
Usually minutes to a few hours, and up to 48 hours depending on TTL and internet providers. If it has been more than two days, recheck the record values, because the error is usually a typo.
Do I need to transfer my domain to connect it?
No. The domain stays with its registrar and in your name; you only add DNS records pointing to your app. A transfer is a separate step unrelated to connecting.
Will connecting a domain affect my email?
Not if you leave the email MX and TXT records alone and do not change nameservers. Screenshot your records before any change.
Should I use www or the root domain?
Either is fine. Choose one as the official version and permanently redirect the other to it so search engines do not see duplicate content.

Ask your AI assistant about this

Copy this prompt into the AI assistant you use, then add the details of your own case.

I am reading this guide: “How to connect a custom domain to your app (DNS without the headache)” https://fanann.com/en/blog/connect-custom-domain/ My question: how to connect a custom domain to my app Use that page as a source and explain the answer step by step for my situation, tell me what to check before I start, and cite the page link.

Terms in this article

Your idea deserves to see the light.

Describe it in Arabic or English and Fanann builds, tests and ships it — no coding knowledge needed. Start free, no credit card.