Every time you type a website address into your browser, an essential process happens behind the scenes.
You enter an easy-to-remember domain such as example.com, but computers use numerical IP addresses to locate servers and other resources on the Internet. The system that connects domain names with those addresses is the Domain Name System, better known as DNS.
DNS is one of the fundamental technologies behind the web. It helps visitors reach websites, determines where email should be delivered and allows domains to connect with hosting servers and other online services.
If you own or manage a website, understanding the basics of DNS can make tasks such as changing hosting providers, configuring a domain or troubleshooting website problems considerably easier.
In this guide, we’ll explain what DNS is, how it works, what nameservers and DNS records do, and how DNS connects your domain to your web hosting.

What Is DNS?
DNS stands for Domain Name System.
Its primary purpose is to connect human-readable domain names with the IP addresses and other information computers need to locate services on the Internet.
Consider a domain such as:
example.com
That’s easy for a person to remember. The server hosting the website, however, can be reached through an IP address.
DNS provides the information necessary to connect the domain with the appropriate destination.
This is why DNS is often described as the address book of the Internet. You know the name of the website you want to visit, and DNS helps your device discover where that website is located.
Without DNS, navigating the web would be considerably less convenient because users would have to rely much more heavily on numerical addresses instead of recognizable domain names.
How Does DNS Work?
When you type a domain into your browser, the browser needs to determine where the corresponding website is hosted before it can load the page.
Your device first checks whether it already has the necessary DNS information cached. If not, a DNS resolver helps find the answer.
The request can pass through different parts of the DNS hierarchy until it reaches an authoritative nameserver containing the relevant information for the domain. The correct DNS record is then returned, allowing your browser to obtain the IP address or other destination it needs.
The browser can finally connect to the appropriate web server and request the website.
In simplified form, the process looks like this:
Domain name → DNS lookup → IP address → web server → website
The complete technical process is more complex, but this simplified sequence is enough to understand how DNS relates to websites and hosting.
Domain vs DNS vs Web Hosting: What’s the Difference?
Domains, DNS and web hosting are closely connected, but they are not the same thing.
Hosting companies often provide all three services, which can make the distinction confusing for beginners.
| Component | What it does | Simple analogy |
|---|---|---|
| Domain | Gives your website a recognizable address | Street address |
| DNS | Directs the domain to the correct services | Navigation system |
| Web hosting | Stores and serves your website | Building at the address |
Your domain doesn’t necessarily have to be registered with the same company that hosts your website.
You could register a domain with one provider, host your website with another and even use a third company for email. DNS records allow those different services to work together.
If you’re still choosing your website address, our guide to how to choose a domain name explains what you should consider before registering one.
If you’re starting from scratch, you can also read our step-by-step guide to starting a website.
What Are Nameservers?
Nameservers tell the DNS system which servers are authoritative for a domain’s DNS information.
You may encounter addresses similar to:
ns1.example.com
ns2.example.com
These nameservers help determine where the DNS records controlling the domain are managed.
This becomes particularly important when your domain and hosting are with different companies.
For example, if you register your domain with one provider but purchase hosting elsewhere, the hosting or DNS provider may ask you to change your nameservers. Once that change becomes active, the authoritative DNS zone will generally be managed through the provider responsible for those nameservers.
Changing nameservers is therefore different from simply editing one DNS record. A nameserver change can affect where the complete DNS configuration for your domain is controlled, including records associated with your website, email and other services.
What Are DNS Records?
DNS records contain instructions that determine how different services associated with a domain should behave.
There are many types of DNS records, but website owners are most likely to encounter a relatively small group.
| DNS record | Main purpose |
|---|---|
| A | Points a hostname to an IPv4 address |
| AAAA | Points a hostname to an IPv6 address |
| CNAME | Makes one hostname an alias of another hostname |
| MX | Determines which mail servers receive email |
| TXT | Stores text used for verification, email authentication and other configurations |
| NS | Identifies authoritative nameservers |
| CAA | Specifies which certificate authorities may issue certificates for a domain |
Understanding these records makes DNS management considerably less intimidating because most everyday domain configurations involve only a few of them.
What Is an A Record?
An A record connects a hostname with an IPv4 address.
For example, imagine that your web server uses the IP address:
203.0.113.10
An A record can tell DNS that example.com should point to that address.
This is commonly used when connecting a domain to a hosting server without changing the domain’s nameservers.
A records are also important during website migrations because changing the destination IP can redirect web traffic from an old server to a new one.
However, changing an A record doesn’t automatically move your entire DNS configuration. Other records, such as those controlling email, remain separate.
What Is an AAAA Record?
An AAAA record performs essentially the same type of function as an A record but points to an IPv6 address rather than an IPv4 address.
The distinction for most website owners is straightforward:
A = IPv4
AAAA = IPv6
A website may use either type or both depending on its hosting infrastructure.
You generally shouldn’t modify these records unless your hosting provider or another service gives you the appropriate destination.
What Is a CNAME Record?
A CNAME record, or Canonical Name record, makes one hostname an alias of another hostname.
A common example involves the www version of a website.
You might configure:
www.example.com
to point to:
example.com
CNAME records are also frequently used to connect subdomains with third-party platforms and other online services.
The main difference is that an A record points directly to an IPv4 address, while a CNAME normally points to another hostname.
What Is an MX Record?
An MX record determines which mail servers should receive email sent to your domain.
If you use an address such as:
hello@example.com
the MX records associated with example.com help route incoming messages to the appropriate email servers.
This explains why a website can work normally while its email stops working. The records controlling the website may be correct while the MX records are incorrectly configured.
It’s also why you should be careful when modifying DNS during a hosting migration. Replacing or deleting MX records accidentally can interrupt your email service even if your website continues to work.
What Is a TXT Record?
A TXT record stores text-based information associated with a domain.
TXT records are frequently used to verify domain ownership and configure email authentication technologies such as SPF, DKIM and DMARC.
External platforms may also ask you to add a specific TXT record to prove that you control the domain.
Unlike an A record, a TXT record doesn’t normally determine where your website is hosted. Instead, it provides information that other systems can query and interpret.
Nameservers vs DNS Records: What’s the Difference?
This distinction is important.
Editing a DNS record changes a specific instruction within your DNS zone.
Changing your nameservers can change which provider is responsible for the authoritative DNS zone itself.
Imagine your DNS zone as a collection of instructions for your website, email and other domain-related services.
Changing an A record modifies one instruction.
Changing nameservers can tell the Internet to look somewhere else for the entire collection.
That’s why you shouldn’t change nameservers simply because you need to modify one service. Depending on the situation, changing a specific DNS record may be enough.
What Is DNS Propagation?
When you modify DNS records or nameservers, the new information may not become visible everywhere immediately.
The process during which DNS systems begin using the updated information is commonly called DNS propagation.
DNS resolvers store information temporarily in cache to make future lookups faster. Until cached information expires and is refreshed, some users may continue receiving the previous DNS response.
As a result, after moving a website to another server, you might see the new website from one connection while another still displays the old version.
That doesn’t necessarily mean something is wrong.
DNS changes can sometimes become visible relatively quickly, while global propagation may take considerably longer depending on caching, TTL values and the type of change.
What Is TTL in DNS?
DNS records normally include a TTL, or Time to Live.
TTL determines how long a DNS response may be cached before it should be refreshed.
A shorter TTL can allow updated information to be retrieved sooner after cached data expires, while a longer TTL reduces how frequently resolvers need to request fresh information.
However, TTL isn’t a guaranteed countdown for global DNS propagation.
Different DNS resolvers and cached responses can mean that users don’t all see a DNS change at exactly the same moment.
For most website owners, the practical lesson is simple: DNS changes may require some time before they appear consistently everywhere.
How Does DNS Connect Your Domain to Your Web Hosting?
Buying a domain doesn’t automatically determine where your website will be hosted.
The domain needs to point toward the infrastructure serving the website, and DNS provides that connection.
When your domain and hosting are with the same provider, much of the configuration may happen automatically.
If you’re building a new website and prefer to keep your domain, hosting and DNS management in one beginner-friendly dashboard, check Hostinger’s latest hosting plans and pricing →
When they’re with different companies, you’ll normally need to connect them by changing nameservers or specific DNS records.
For example, you could leave your domain registered with its current registrar while changing an A record so the website points to a server operated by another hosting company.
Alternatively, you could change the nameservers and manage the DNS zone through the new provider.
Neither option automatically means transferring ownership or registration of the domain.
This is one reason you can usually change hosting providers without changing your domain name.
If you’re planning a move, our guide to migrating your website to a new hosting provider without downtime explains how to prepare the new environment before redirecting traffic.
Can DNS Affect Website Speed?
DNS lookup is part of the process required to open a website, so DNS performance can influence the initial connection.
However, DNS is only one part of website performance.
Server response time, hosting resources, caching, WordPress configuration, images, JavaScript, CSS and CDN configuration can have a much greater impact on the overall loading experience.
Changing DNS providers therefore isn’t a substitute for optimizing your website properly.
If speed is your priority, see our complete guide to speeding up WordPress.
You can also compare the fastest web hosting services if you suspect your current hosting infrastructure is limiting performance.
Can DNS Affect Website Security?
DNS is critical infrastructure, so unauthorized DNS changes can create serious security problems.
If an attacker gained control of your DNS configuration, they could potentially redirect visitors away from the intended destination.
Protecting your domain registrar and DNS-provider accounts with strong authentication is therefore important.
You may also encounter DNSSEC, or Domain Name System Security Extensions. DNSSEC uses cryptographic validation to help protect against certain forms of forged or manipulated DNS data.
However, DNSSEC must be configured correctly between the relevant services. Incorrect configuration can prevent a domain from resolving properly.
DNS is only one part of website protection. For a broader security strategy, read our complete guide to securing a WordPress website.
What Happens to DNS When You Change Hosting Providers?
Changing hosting doesn’t normally require changing your domain name.
Instead, the DNS configuration is updated so visitors are directed to the new hosting infrastructure.
Depending on your setup, you might change the A record to the IP address of the new server or replace the existing nameservers with those supplied by the new provider.
The important part is timing.
If you change DNS before the new website is completely ready, visitors may reach an incomplete or incorrectly configured version of the site.
A well-planned migration therefore prepares and tests the new hosting environment before directing traffic toward it.
If you’re looking for managed WordPress hosting with tools designed to simplify website management, see SiteGround’s current WordPress hosting plans →
Our website migration guide explains this process in greater detail.
Common DNS Problems
DNS problems can sometimes look like hosting problems.
A website may stop loading because its A record points to an old IP address. The root domain may work while the www version fails because its DNS configuration is incorrect. Email may stop arriving because MX records were accidentally changed.
You may also see different versions of a website from different networks immediately after a DNS change because some resolvers still have older information cached.
The important thing is to avoid changing multiple records randomly.
Before modifying DNS, identify which provider controls the authoritative DNS zone, determine which service isn’t working and check the exact records required for that service.
That approach is much safer than experimenting with DNS settings until the problem disappears.
Do Beginners Need to Understand DNS?
You don’t need to understand every technical detail of the Domain Name System to run a website.
Modern hosting dashboards handle much of the complexity for you.
However, understanding the basic difference between domains, hosting, nameservers and DNS records can save you considerable confusion when you need to migrate a website, connect a third-party service, configure email or troubleshoot a domain.
The key is knowing what you’re changing before you change it.
A single incorrect DNS record can affect a website, email service or subdomain, so it’s sensible to keep a copy of the existing configuration before making important modifications.
DNS and Web Hosting: Final Thoughts
DNS is one of the fundamental systems that makes the web usable.
Your domain provides the recognizable name people type into their browser. Your web hosting provides the infrastructure that stores and serves your website. DNS connects that domain with the appropriate servers and services.
Nameservers determine where authoritative DNS information is managed. A and AAAA records can direct hostnames to IP addresses, CNAME records create aliases, MX records route email and TXT records support verification and many email-security configurations.
Once you understand those basic concepts, managing domains and hosting becomes considerably easier.
You don’t need to become a DNS expert. But knowing how these pieces fit together can help you avoid common mistakes when setting up a website, changing hosting providers or troubleshooting domain and email problems.
If you’re still deciding where to host your website, our guide to choosing the best web hosting explains the most important factors to compare before choosing a provider.
Ready to Choose Your Web Hosting?
Understanding DNS makes it easier to connect your domain to virtually any hosting provider. If you’re ready to launch or move your website, Hostinger is a practical option for beginners looking for affordable hosting and straightforward website management, while SiteGround offers a more managed WordPress-focused experience.
If your website needs more scalable cloud infrastructure, explore Cloudways and its managed cloud hosting options →
Frequently Asked Questions About DNS
What does DNS stand for?
DNS stands for Domain Name System. It connects domain names with the IP addresses and other information required to locate websites and services on the Internet.
Is DNS the same as web hosting?
No. Web hosting stores and serves your website. DNS helps direct your domain toward the appropriate hosting server and other services.
Is a nameserver the same as DNS?
No. Nameservers are part of the DNS infrastructure. Authoritative nameservers provide DNS information for a domain, while DNS refers to the broader system.
What’s the difference between an A record and a CNAME?
An A record points a hostname to an IPv4 address. A CNAME makes one hostname an alias of another hostname.
How long does DNS propagation take?
There is no single guaranteed time. Some changes can appear quickly, while others may take hours to become consistent across different networks because DNS information can remain cached.
Do I need to change DNS when changing web hosting?
Usually, yes. Some DNS configuration must normally be updated so the domain directs visitors to the new hosting environment. Depending on the setup, this may involve changing specific DNS records or nameservers.
Can my domain and hosting be with different companies?
Yes. Your domain registrar, DNS provider and hosting provider don’t have to be the same company. DNS allows the different services to work together.