Skip to main content

Pointing your domain at HostingSwift

A records, CNAMEs, TTLs and how to move a live site without downtime.

Connecting a domain is the step most people find fiddliest, mostly because DNS is invisible. Here is the whole picture.

The two records that matter

A record — maps a hostname to an IPv4 address.

text
example.com.        A      203.0.113.10
www.example.com.    A      203.0.113.10

CNAME — maps a hostname to another hostname.

text
www.example.com.    CNAME  yoursite.hostingswift.example

Use an A record when you have a stable IP. Use a CNAME when the destination's IP may change and you would rather follow the name. You cannot put a CNAME at the domain apex (example.com) in strict DNS — many providers offer a workaround ("ALIAS", "ANAME", or flattened CNAME) and we support those where the registrar does.

In practice

  1. Find the DNS settings for your domain — either in your HostingSwift panel under Domains, or at your registrar.

  2. Add an A record for @ (the apex) → your service IP.

  3. Add an A record or CNAME for www → the same IP or your hosting hostname.

  4. Save. Changes propagate within the record's TTL.

TTL: the dial that decides how fast change happens

Every record has a TTL (time-to-live) — how long resolvers may cache the answer.

  • Low TTL (300s or 60s) — changes go live fast. Use this before a planned migration.

  • High TTL (3600s+) — fewer queries, slower to change.

Before moving a live site, lower the TTL a day in advance to 300 seconds, make the move, then raise it again. That way the switch is nearly instant for everyone.

Moving a live site with no downtime

  1. Stand up the new site and test it on a temporary hostname or by editing your local hosts file.

  2. Lower the TTL for the records you are about to change.

  3. Switch the A record to the new IP.

  4. Keep the old site running for at least the old TTL, then decommission it.

  5. Restore the TTL to its normal value.

Full detail, including mail records you must not forget, is in Migrating your hosting to HostingSwift.

Common mistakes

  • Forgetting www. Apex and www are separate names; set both.

  • Changing nameservers and the A record. Pick one approach; mixing them causes confusion.

  • Ignoring the TTL and then waiting an hour for a "simple" change.

  • Breaking email. If you host mail elsewhere, do not delete the MX records while editing DNS.

  • Typo in the IP. DNS will happily publish a wrong address.

Related reading