How DNS Works
We’ll start with the basics of what happens when someone types a URL into a browser, reviewing what we already covered and expanding on it.
The Internet is a big network of computers. Each computer has an address (IP address) that identifies its location in the network.
Websites live on computers. When your computer wants to read a page from a website, your browser has to find the IP address of the computer where the website lives.
It’s too difficult to remember IP addresses, so we use short, memorable domain names instead.
For example, google.com is much easier to remember than 142.250.188.238.
Another benefit of using domain names instead of IP addresses to refer to websites is that domain names aren’t locked into one specific machine. If there is a problem with the computer located at one IP address, a domain name can be pointed at a different IP address to avoid downtime.

When you visit a URL in your Web browser, the browser uses DNS (the Domain Name System) to look up the domain name and find the IP address where the website currently lives. The browser can then send its request to the computer at that IP address.

In earlier sections we looked at how to manually look up a website’s IP address. The browser is querying the same system to find the IP address.
How to Configure a Website’s Nameservers
When creating a website, there are two important steps:
- Register a domain name from a registrar. Some hosting services also let you borrow a subdomain to point at your server.
- Get some Web hosting from a hosting company.
In this section we’ll go over how they fit together.
Nameservers
When you register a domain name with a registrar (like Gandi.net), you designate nameservers for the domain.
The registrar will typically have the domain pointing to their own nameservers. You can manage the DNS settings there or choose to point the domain to external nameservers. For example, I use Cloudflare to manage my DNS records, so I pointed this codingforseo.com domain at two of Cloudflare’s nameservers:
Name Server: ALEX.NS.CLOUDFLARE.COM
Name Server: MAY.NS.CLOUDFLARE.COM
Cloudflare then manages the details of the domain’s settings even though the domain is registered with Gandi.
DNS Records
Then, in the Cloudflare dashboard, I’ve set up my DNS records to point various parts of the domain to different servers.
This website is hosted on Fly.io, so when I set up Fly they gave me a couple of IP addresses along with instructions on how to enter them into the nameserver dashboard.
There are various kinds of DNS records:
A— these records point to IPv4 IP addresses.AAAA— these records point to IPv6 addresses.CNAME— these are often used to point subdomains on your domain to subdomains on other servers.MX— these records point to the servers that host your email.TXT— these records contain extra data that is often used for verification purposes. You’ll often use this when setting up Google Search Console or adding transactional email systems to a website.
Here’s a screenshot of what a typical DNS dashboard looks like. The “Type” column refers to the type of record. So, as mentioned above, the A records contain IPv4 addresses in their “Content” column, the AAAA records point to IPv6 addresses, and the CNAME records point to external subdomains. At the bottom is a TXT record that Google uses to verify ownership of the site for Google Search Console.

The IP Addresses
The IP addresses for A and AAAA records come from the hosting company. A hosting company will typically allocate some server space for you and give you an IP address(es) to add to your DNS records. You create A record for the IPv4 address and/or an AAAA record for the IPv6 address.
For now, we’re just going through a general overview. In a later tutorial we’ll walk through the complete process, step-by-step.
Takeaways
Things you should remember from this section:
- Domains are registered with registrars.
- From the registrar’s dashboard, you can point the domain to any nameservers you want.
- DNS settings are then entered into the nameserver dashboard, including the IP address(es) of your website.
- When visitors type in your domain name, the DNS (Domain Name System) will look up the IP address of your site and point them to the correct computer to talk with.