Make software by describing it

How to Connect a Custom Domain to Your Site

To connect a custom domain to a static site, you buy the domain from a registrar, then add DNS records that point it to your host, and then tell the host about the domain. The records are usually one or two short entries copied from your host’s instructions. After a wait that can range from minutes to a day or so, the site loads at your own address.

Domains are not free, though the cost is modest in most cases. Prices vary by registrar and by the ending, such as .com or .net, and renewal prices can differ from the first-year price, so read the details before you pay.

What a domain does

Your site lives on a host with an address built from numbers, which people cannot remember. A domain name is a readable label that points to it. The system that links the two is called DNS, the domain name system. You can think of it as a phone book: when someone types your domain, DNS tells their browser which server to ask.

Buying a domain gives you the right to use that name for a period, usually a year at a time. You manage where it points through a settings page at your registrar or at a separate DNS provider.

Choose and buy the name

Pick a name that is short, easy to spell aloud, and free of hyphens and numbers where possible. Search several registrars for availability and compare the total cost, including renewal, and what is included. Some include privacy protection for your contact details, while others charge extra. Keep in mind that registrars are required to keep contact information for each domain, and the privacy option hides it from public lookup.

Avoid names that copy another company’s brand, which can lead to disputes. If you are unsure, ask for advice from a legal professional.

Add the domain to your host

Most hosts have a section for custom domains. Enter your domain there, and the host will show you what DNS records to create. Typically there are two cases:

Copy the values exactly as the host shows them. Do not guess. Different hosts use different records, and they sometimes update them.

Add the records at your registrar

Log in to where you bought the domain and find DNS settings, sometimes called DNS management or nameservers. Add the records the host asked for. Check each field:

  1. Type (A, CNAME or similar).
  2. Name or host, where @ usually means the bare domain and www means that subdomain.
  3. Value, the address from your host.
  4. TTL, which can stay at the default.

Remove conflicting old records, such as a parking page record that came with the domain. Two records for the same name with different values cause unpredictable results.

Wait, then verify

DNS changes take time to spread, since many servers cache old answers. Sometimes it takes a few minutes, but allow up to a day. In the meantime, the host’s dashboard usually shows whether it can see your domain pointing correctly. Free online DNS lookup tools can also show what the world sees.

If nothing changes after a day, recheck the records for typos, especially the name field, which differs between registrars.

Turn on HTTPS

Visitors expect the address to start with https, which means the connection is encrypted. Most static hosts provide free certificates and issue them automatically after your DNS is correct. Look for an option such as “enable HTTPS” or “force HTTPS” in the domain settings and switch it on.

If you see a certificate warning in the browser, the certificate may not be ready yet. Wait a short time and try again. If it persists, check that your DNS records match the host’s instructions and that you have no extra conflicting records.

Handle www and the bare domain

Decide which version is your main address and redirect the other to it. For example, send www.example.com to example.com. Many hosts do this automatically when you add both. Leaving both versions live, with the same content, can confuse search engines and visitors.

Renewal and safety

Domains expire if you do not renew them. Turn on auto-renew and keep a payment method current, since losing a domain can break every link you have shared. Use a strong, unique password and two-step verification on your registrar account, because control of the domain is control of your site’s address.

Troubleshooting checklist

If the domain does not work after a day, go through these checks in order. First, confirm the domain is active and not waiting on email verification, which some registrars require before it works. Second, compare each DNS record with your host’s instructions, character by character, paying attention to the name field. Third, look for old records that conflict, such as a parking page. Fourth, check that you added the domain in the host’s dashboard as well as at the registrar. Fifth, test with a different network or a private window, because your own device may cache an old answer.

If you still see nothing, send your records and the host’s instructions to your assistant, hiding any private details, and ask it to compare them. Mismatches are common and easy to spot with a second set of eyes.

Next steps

Choose a name, check prices at two registrars, and buy one only when you are ready to use it. Add the domain to your host, copy the records exactly, and set a reminder to check back in a few hours. When the site loads over HTTPS, write the registrar, the renewal date and the DNS records in your notes file.