You bought a domain from one company and hosting from another, and now nothing loads when you type your address into a browser. That is normal, and it is fixable in a few minutes once you understand what is happening. This guide is for beginners who need to connect a domain to a web host, and it explains every DNS record you will touch in plain language, without assuming you already know the jargon.
What DNS actually does
Every website lives on a server, and every server has a numeric address called an IP address, something like 203.0.113.10. People cannot remember numbers like that, so we use names instead. DNS, the Domain Name System, is the phone book that translates your human-friendly name into the numeric address a computer needs.
When someone visits your site, their browser asks a chain of DNS servers, "Where does this name point?" The answer comes from your DNS records. If those records are missing, wrong, or still pointing at an old provider, the visitor either sees an error or lands on the wrong server. Pointing your domain to your hosting simply means editing those records so they return your new host's address.
Two ways to connect a domain to hosting
There are two common methods, and you only need one of them.
- Change the nameservers. Your registrar, the company you bought the name from, lets you set which nameservers are authoritative for the domain. If you point them at your host, the host manages all your DNS records for you. This is the simplest option for most people because your hosting control panel handles the details.
- Edit individual records. You keep DNS at your registrar or a third party like Cloudflare and manually create the records that point to your host. This gives you more control and is handy when your email, website, and other services live in different places.
If your host gave you a pair of nameservers such as ns1.example.com and ns2.example.com, the intended path is usually the nameserver method. If they gave you an IP address instead, you are meant to edit records yourself. Whichever route you choose, changes take time to spread, which we cover below.
The DNS records you need to know
DNS records come in types, and each one has a job. Here are the records that matter when you connect a domain to a web hosting account.
A record
The A record maps a name to an IPv4 address. This is the core record that makes your website load. You typically set one A record for the bare domain (written as @ in most control panels) and one for www, both pointing at your host's server IP. If your host handed you an IP address, this is the record you create.
AAAA record
The AAAA record does the same job as an A record but for IPv6, the newer and much larger address format. If your host supports IPv6, they will give you an IPv6 address to put here. A site works fine over IPv4 alone, so this record is optional, but adding it is good practice and future-proof.
CNAME record
A CNAME is an alias. Instead of pointing a name at an IP address, it points one name at another name. A common use is making www a CNAME of your root domain, so if the server IP ever changes you only update it in one place. Classic DNS does not allow a CNAME on the bare root domain, so the root usually stays an A record while subdomains use CNAMEs.
MX record
MX stands for mail exchange, and these records decide where your email is delivered. They point at mail servers rather than web servers, and each MX record carries a priority number where a lower value means "try this one first." This split matters because your website and your email can live on completely different systems. Switch web hosts without keeping your MX records correct and your site may load fine while your inbox quietly stops receiving mail.
TXT record
TXT records hold plain text and are used for verification and email security. You will meet them in three common forms: SPF, which lists the servers allowed to send mail for your domain; DKIM, which adds a cryptographic signature to your outgoing email; and DMARC, which tells receivers what to do with mail that fails those checks. Many services also ask you to add a TXT record to prove you own the domain before they activate a feature.
NS records and nameservers
NS records name the servers that are authoritative for your domain. When you change nameservers at your registrar, you are deciding which provider's NS records the internet should trust. Everything else, your A, MX, and TXT records, then gets managed wherever those nameservers live.
TTL and propagation: why changes are not instant
Every record has a TTL, or time to live, measured in seconds. TTL tells other DNS servers how long they may cache the answer before checking again. A TTL of 3600 means a resolver can hold the old value for up to an hour.
This is why edits are not instant. When you change a record, servers that already cached the old value keep serving it until the TTL expires. The gradual spread of the new value across the internet is called propagation. Nameserver changes can take longer, sometimes several hours, because they sit higher up the chain.
Two practical tips. First, if you know a change is coming, lower the TTL to 300 seconds a day ahead of time so the switch happens quickly. Second, do not panic if the site works on your phone but not your laptop for a while. That is caching, not a broken record, and it clears on its own. If you are moving an existing live site rather than launching a fresh one, our guide on how to migrate a website with no downtime walks through the exact sequence that avoids gaps.
Step by step: pointing your domain
- Get the target details from your host: either a nameserver pair or a server IP address, plus any records they specify.
- Log in to your registrar, the company where you bought the domain.
- If using nameservers, replace the existing ones with your host's pair and save. You are done, and the host manages the rest.
- If editing records, create an A record for @ pointing to the server IP, and a CNAME or A record for www.
- Add or keep the correct MX and TXT records so email keeps flowing.
- Wait for propagation, then confirm the change with a DNS lookup tool, load your site, and send a test email in both directions.
Common mistakes and how to avoid them
- Mixing both methods. If you delegate to your host's nameservers, records you edit at the registrar are ignored. Manage records in one place only.
- Forgetting email. Changing web hosting without carrying over your MX and email TXT records is the most common way people accidentally break their inbox.
- Leaving old A records behind. A stale record pointing at a previous host sends some visitors to a dead server. Delete records you no longer use.
- Typing the wrong IP. One wrong digit means the domain resolves to nothing. Copy and paste rather than retyping.
- Expecting instant results. Give propagation time before assuming something is wrong, and lower TTLs in advance when you can.
Putting it all together
Pointing a domain at hosting comes down to a small set of records doing predictable jobs: A and AAAA send visitors to your web server, CNAME creates aliases, MX routes your mail, and TXT proves ownership and secures email. Pick one place to manage DNS, set the records your host gave you, keep your mail records intact, and allow a little time for propagation. Once it clicks, the same knowledge lets you move any domain or service with confidence.