Every website needs a domain name, and every domain relies on DNS to work. These systems often feel mysterious until something goes wrong, such as a site disappearing after a hosting move or email suddenly failing. Understanding a few basic ideas makes those situations much less stressful.

What a domain is

A domain is the human-friendly address of your website. You do not buy it outright. You register it for a period, usually one or more years, through a registrar. If you forget to renew, the domain can expire and eventually be registered by someone else, so turn on automatic renewal and keep your contact email current.
What DNS does
Computers find each other using numeric IP addresses. DNS, the Domain Name System, translates a domain into those numbers. When someone types your domain, their device asks DNS servers where to go, and the answer points them to the server hosting your site.
Nameservers
Nameservers are the DNS servers that hold the official records for your domain. At your registrar, you choose which nameservers are in charge. They might belong to the registrar, your web host or a separate DNS provider. Changing nameservers moves control of all your DNS records to a new place, so it should be done carefully and deliberately.
Common record types
- A record: points a name to an IPv4 address, such as your web server.
- AAAA record: the same, for IPv6 addresses.
- CNAME record: makes one name an alias of another, often used for “www”.
- MX record: tells the world where to deliver your email.
- TXT record: holds text used for verification and email security.
Propagation
DNS answers are cached for a period set by each record’s time to live. After a change, some visitors may see the old answer for a while. Lowering the time to live a day before a planned move can make the switch faster.
DNS and hosting moves
When you change hosts, you normally update the A record or nameservers to point to the new server. Set up and test the new site first, then switch DNS. The hosting side of that decision is covered in How to Choose Web Hosting for a Small Website.
DNS, speed and security
Some DNS providers also act as a content delivery network and offer free SSL, which can improve both speed and security. See Website Speed Basics and A Practical WordPress Security Checklist for how these fit together. Protect your registrar and DNS accounts with strong passwords and two-factor authentication, because whoever controls DNS effectively controls your website and email.