Flexy Blogs

How to Point a Domain Name to Your Website (DNS Explained Simply)

How to Point a Domain Name to Your Website (DNS Explained Simply)
Photo by Mediamodifier on Unsplash

Connecting a domain to a website means editing DNS records. This step-by-step guide explains nameservers, A records and CNAMEs, and how to avoid the mistakes that take sites offline.

You have bought a domain name and you have a website hosted somewhere. Connecting the two is done through the Domain Name System (DNS), the internet's address book, which translates a name like example.com into the address of the server that hosts the site. The steps are simple once you know which settings to change.

Two ways to connect a domain

Option 1: Change the nameservers

Nameservers decide who manages your domain's DNS records. Your web host or DNS provider gives you two or more nameserver addresses. You enter them at your domain registrar, the company where you bought the domain. From then on, all DNS records are managed at the new provider.

Use this when your host recommends it and you want everything in one place.

Option 2: Keep the nameservers and edit DNS records

Leave DNS at your registrar or current DNS provider and add the specific records your host gives you.

Use this when you have other services on the domain, such as business email, that you do not want to disrupt.

Important: if you change nameservers, any existing records, including those for email, must be recreated at the new provider, or those services will stop working.

The records you need to know

RecordWhat it doesExample
APoints a name to an IPv4 addressexample.com to 203.0.113.10
AAAAPoints a name to an IPv6 addressexample.com to 2001:db8::10
CNAMEPoints a name to another namewww to example.com
MXDirects email for the domainYour email provider's servers
TXTHolds text for verification and email securitySPF, site verification codes

Step by step: editing records

  1. Get the target details from your host: usually an IP address for an A record, or a hostname for a CNAME.
  2. Log in to your DNS provider and open the DNS management page for the domain.
  3. Set the root domain (often shown as @): edit or create the A record so it points to your host's IP address. Remove old A records for @ that point elsewhere.
  4. Set the www subdomain: create a CNAME for www pointing to your root domain or to the hostname your host provides.
  5. Leave MX and TXT records alone unless you are changing email providers.
  6. Save and wait for the change to take effect.

www or no www?

Choose one version as your main address and redirect the other to it, so visitors and search engines always end up at a single URL. Most hosts let you set this in their dashboard. Consistency matters more than which you choose.

How long does it take?

DNS changes are cached around the internet for the period set by each record's TTL (time to live). Many changes appear within minutes to a few hours; nameserver changes can take up to a day or two to be seen everywhere. Lowering the TTL a day before a planned change can speed things up.

To check progress, use an online DNS lookup tool that queries servers in several locations, or run nslookup example.com from a command prompt.

Secure it with HTTPS

Once the domain points to your site, enable an SSL/TLS certificate so the site loads over HTTPS. Many hosts do this automatically using free certificates from Let's Encrypt. Then redirect all HTTP traffic to HTTPS.

Common mistakes

  • Changing nameservers and forgetting to recreate email records
  • Leaving an old A record in place alongside the new one
  • Creating a CNAME on the root domain where your provider does not support it
  • Letting the domain expire; switch on auto-renew and keep your registrar contact email current

Sending email from your domain? Set up authentication next; see SPF, DKIM and DMARC explained. Then make your new site fast with our guide to compressing images for the web.

FlexyBlogs Editorial Team

Practical guides from the FlexyBlogs editors
Articles under this byline are researched and written by the FlexyBlogs editorial team. We link to primary sources such as government agencies, standards bodies and official documentation, and we update articles when guidance changes. Some drafts are prepared with the help of AI writing tools and are edited and fact-checked by a member of the team before publication. Spotted an error? Tell us through the contact page.
View all posts

0 Comments

No comments yet — be the first to share what you think.

Leave a reply

Your email address is never published.