A domain name is a human-readable address that points to a server on the internet. When you type
example.com
into a browser, your computer does not know what
example.com
means. It needs an IP address, a numeric identifier like
93.184.216.34
, to connect to the right server. The domain name is the layer that translates a name you can remember into the IP address your computer needs. That translation happens through DNS, the Domain Name System, which is effectively the phone book of the internet.
Every website, email server, and web service you use depends on domain names. Understanding how they work helps you make better decisions about registration, DNS configuration, email setup, and troubleshooting when something stops resolving.
How domain names are structured#
A domain name has multiple parts separated by dots, and each part serves a different purpose.
Take
www.example.com
as an example:
- com is the top-level domain (TLD)
- example is the second-level domain (the part you register)
- www is a subdomain
Top-level domains (TLDs)
The TLD is the rightmost part of the domain name. The original TLDs were:
- .com – commercial (now used for everything)
- .org – organizations (now used broadly)
- .net – network infrastructure (now used broadly)
- .edu – educational institutions (restricted)
- .gov – US government (restricted)
- .mil – US military (restricted)
Country-code TLDs (ccTLDs) represent countries:
.uk
(United Kingdom),
.de
(Germany),
.ca
(Canada),
.au
(Australia). Some ccTLDs are used creatively outside their country, like
.io
(British Indian Ocean Territory, popular with tech companies) and
.tv
(Tuvalu, used for streaming).
Since 2012, hundreds of new generic TLDs have been introduced:
.app
,
.dev
,
.blog
,
.shop
,
.xyz
, and many more. These work identically to
.com
from a technical perspective. The difference is perception. Most businesses still prefer
.com
because it is what people expect and type by default.
Second-level domain
The second-level domain is the part you choose and register. In
hostney.com
, “hostney” is the second-level domain. This is your brand, your identity, and the part you control. You register it through a domain registrar and pay an annual fee to keep it.
Subdomains
A subdomain is anything to the left of your registered domain.
www.example.com
,
blog.example.com
,
shop.example.com
, and
mail.example.com
are all subdomains of
example.com
. You can create as many subdomains as you want without registering anything new. They are configured through DNS records on the domain you already own.
www
is technically a subdomain, not part of the domain name itself.
example.com
and
www.example.com
are different addresses that may or may not point to the same server. Most websites configure both to work and redirect one to the other for consistency.
How DNS translates domain names to IP addresses#
When you type a domain into your browser, a multi-step lookup process happens in milliseconds:
- Browser cache check. Your browser checks if it has recently looked up this domain and still has the IP address cached. If yes, it uses the cached result and skips the rest.
- Operating system cache check. If the browser cache does not have it, the OS checks its own DNS cache. On Linux, this is managed by systemd-resolved or nscd. On Windows and macOS, the OS maintains a system-wide DNS cache.
- Recursive resolver query. If the local caches are empty, your device sends a DNS query to its configured DNS resolver. This is usually your ISP’s DNS server, or a public resolver like Cloudflare (1.1.1.1) or Google (8.8.8.8). The resolver handles the rest of the lookup on your behalf.
- Root server query. The resolver asks one of the 13 root server clusters, “Where can I find information about .com domains?” The root server responds with the address of the .com TLD nameservers.
- TLD nameserver query. The resolver asks the .com nameserver, “Where can I find information about example.com?” The TLD nameserver responds with the address of the authoritative nameservers for example.com, which were set when the domain was registered.
- Authoritative nameserver query. The resolver asks the authoritative nameserver, “What is the IP address for example.com?” The authoritative nameserver responds with the A record (IPv4 address) or AAAA record (IPv6 address).
- Response. The resolver sends the IP address back to your device. Your browser connects to that IP address and loads the website.
This entire process takes 20-100 milliseconds on a typical connection. The result is cached at multiple levels so subsequent visits to the same domain skip most of these steps.
You can see this lookup in action using
dig
:
dig example.com
Or using SiteProbe’s DNS lookup tool to check what records a domain has from an authoritative perspective.
If this lookup fails at any step, you get a DNS server not responding error or a dns_probe_finished_bad_config error in your browser. The site is not down. Your device just cannot figure out where to connect.
DNS records: what they do#
Once a domain is registered and pointed to nameservers, the actual configuration lives in DNS records. Each record type serves a different purpose.
A record
Maps a domain name to an IPv4 address. This is the most fundamental DNS record. When someone visits your website, the A record tells their browser which server to connect to.
example.com A 93.184.216.34
AAAA record
Same as an A record but for IPv6 addresses. As IPv6 adoption grows, having both A and AAAA records ensures your site is reachable from both IPv4 and IPv6 networks.
example.com AAAA 2606:2800:220:1:248:1893:25c8:1946
CNAME record
Creates an alias from one domain name to another. Instead of pointing to an IP address, a CNAME points to another domain name. The resolver follows the chain to find the final IP.
www.example.com CNAME example.com
This means
www.example.com
points to whatever IP address
example.com
resolves to. If you change the A record for
example.com
, the
www
subdomain automatically follows. CNAMEs are commonly used for
www
subdomains and for pointing subdomains to external services (like a CDN or a SaaS platform).
MX record
Specifies which mail servers handle email for the domain. Without MX records, email sent to your domain has nowhere to go. For a detailed explanation of how MX records work and how to configure them for different email providers, see MX records explained: how email routing works.
example.com MX 10 mail.example.com
TXT record
Stores arbitrary text data. Used for email authentication (SPF, DKIM, DMARC), domain ownership verification, and other purposes.
example.com TXT "v=spf1 include:_spf.google.com ~all"
NS record
Specifies which nameservers are authoritative for the domain. These are set at the registrar and tell the DNS system where to find the rest of the domain’s records.
example.com NS ns1.cloudflare.com
example.com NS ns2.cloudflare.com
TTL and DNS propagation#
Every DNS record has a TTL (Time to Live) value measured in seconds. The TTL tells DNS resolvers how long they can cache the record before checking for updates. A TTL of 3600 means the resolver caches the record for one hour. After that hour, the next query for that domain triggers a fresh lookup.
When you change a DNS record, the change is not instant globally. Resolvers around the world have cached the old record for up to the TTL duration. A record with a TTL of 86400 (24 hours) means some resolvers will serve the old IP address for up to 24 hours after you make the change. This delay is what people call “DNS propagation.”
Propagation is not a single event that takes a specific amount of time. It is thousands of independent caches expiring at different times based on when they last queried the record. Some visitors see the change immediately (their resolver’s cache expired or they never visited before). Others see it hours later.
If you are planning a DNS change (like migrating to a new hosting provider), reduce the TTL to 300 seconds (5 minutes) a day or two before the migration. This ensures caches expire quickly after the change. After the migration is complete and verified, increase the TTL back to 3600 or higher for normal operation.
You can check the current TTL for a domain’s records with:
dig example.com +noall +answer
Or use tools.hostney.com/dns to see the TTL alongside the record values.
For a complete guide on clearing your local DNS cache when you need to see changes immediately, see How to flush DNS cache on Linux, Mac, and Windows.
Domain names vs URLs#
A domain name is not the same thing as a URL, though they are often confused.
Domain name:
example.com
– identifies the server.
URL (Uniform Resource Locator):
https://www.example.com/blog/article?id=123
– identifies a specific resource on the server.
A URL contains the protocol (`https://`), the domain name (`www.example.com`), the path (`/blog/article`), and optionally query parameters (`?id=123`). The domain name is one component of the URL, not the whole thing.
When people say “what is your website address,” they usually mean the domain name. When developers refer to URLs (or more precisely, URIs), they mean the complete address including protocol, path, and parameters.
Registrars vs hosting providers#
These two services are frequently confused because many companies offer both, but they serve different functions.
A domain registrar is where you register and manage your domain name. The registrar interacts with the registry (the organization that manages a TLD, like Verisign for .com) to reserve the domain in your name. Popular registrars include Cloudflare Registrar, Namecheap, Google Domains (now Squarespace Domains), and GoDaddy. Registration typically costs $10-15/year for a .com domain.
A hosting provider is where your website files and database actually live. The hosting provider gives you a server (shared, VPS, or dedicated) where your site runs. You point your domain’s DNS records to the hosting provider’s servers.
You do not have to use the same company for both. In fact, keeping them separate is often better. If you want to switch hosting providers, you only need to update DNS records. If you want to switch registrars, you can transfer the domain without touching your hosting. Coupling them means switching one requires dealing with the other.
When you register a domain, the registrar asks you to set nameservers. These can be the registrar’s own nameservers (if they provide DNS management), your hosting provider’s nameservers, or a third-party DNS service like Cloudflare. The nameservers determine where your DNS records are managed.
How to register a domain#
- Choose a domain name. Keep it short, memorable, and easy to spell. Avoid hyphens and numbers. Check that it does not conflict with existing trademarks.
- Check availability. Use your registrar’s search tool to verify the domain is available. If the exact .com is taken, consider whether an alternative TLD makes sense for your use case, or whether a slightly different name with .com is the better long-term choice.
- Register through a registrar. Provide your contact information (or enable WHOIS privacy to hide it), choose the registration period (1-10 years), and pay. Registration is an annual renewal. If you forget to renew, the domain expires and can be registered by someone else.
- Configure nameservers. Point the domain to the nameservers where you will manage your DNS records. If your hosting provider manages DNS, use their nameservers. If you use Cloudflare for DNS, use Cloudflare’s nameservers.
- Add DNS records. At minimum, you need an A record pointing to your hosting server’s IP address. If you use email, add MX records. If you send email from the domain, add SPF, DKIM, and DMARC records.
- Enable auto-renewal. Domain expiration is one of the most common causes of unexpected website outages. Enable auto-renewal at your registrar to prevent it.
DNSSEC: securing DNS lookups#
Standard DNS has no built-in authentication. When your resolver receives an answer, it trusts that the answer is correct. This makes DNS vulnerable to spoofing attacks where an attacker intercepts the query and returns a fake IP address, redirecting visitors to a malicious server.
DNSSEC (DNS Security Extensions) adds cryptographic signatures to DNS records. Resolvers that support DNSSEC verify these signatures before accepting the answer. If the signature does not match, the answer is rejected. For a detailed explanation of how DNSSEC works and why it matters, see What is DNSSEC and why does it matter for your website.
Troubleshooting domain issues#
For a comprehensive guide to DNS errors and their causes, including NXDOMAIN, SERVFAIL, and propagation issues, see the dedicated troubleshooting reference.
Domain not resolving
If your domain is not loading in a browser, check each layer:
# Does the domain have DNS records?
dig example.com
# Are the nameservers correct?
dig NS example.com
# Is the A record pointing to the right IP?
dig A example.com
Use tools.hostney.com/dns to verify records from an authoritative source. If the records look correct but the site still does not load, the issue is likely at the server level, not DNS. See “This site can’t be reached” for the full diagnostic.
Domain recently changed but still showing old site
DNS caches are holding the old record. Wait for the TTL to expire, or flush your local DNS cache to force a fresh lookup from your device. Other visitors on different networks will see the change at different times depending on their resolver’s cache state.
Email not working after domain registration
You need MX records. A domain with only an A record handles web traffic but not email. See MX records explained for how to configure email delivery.
On Hostney, DNS records are managed through the control panel under Domains > DNS. When you add a domain to your hosting account, the platform creates the necessary A records and provides the nameserver addresses to configure at your registrar. MX records, SPF, DKIM, and DMARC records need to be configured separately based on your email provider.