⇦ Back

WDX-180

Web Development X

What is a Domain Name?

(Updated: 15/08/2023)

Prerequisites:

Objective:

Summary

Domain names are a key part of the Internet infrastructure. They provide a human-readable address for any web server available on the Internet.

Any Internet-connected computer can be reached through a public IP Address, either an IPv4 address (e.g. 192.0.2.172) or an IPv6 address (e.g., 2001:db8:8b73:0000:0000:8a2e:0370:1337).

Computers can handle such addresses easily, but people have a hard time finding out who is running the server or what service the website offers. IP addresses are hard to remember and might change over time.

To solve all those problems we use human-readable Internet addresses called domain names.

Deeper dive

Structure of domain names

A domain name has a simple structure made of several parts (it might be one part only, two, three…), separated by dots and read from right to left:

Anatomy of the MDN domain name

Each of those parts provides specific information about the whole domain name.

Buying a domain name

Who owns a domain name?

You cannot “buy a domain name”. This is so that unused domain names eventually become available to be used again by someone else. If every domain name was bought, the web would quickly fill up with unused domain names that were locked and couldn’t be used by anyone.

Instead, you pay for the right to use a domain name for one or more years. You can renew your right, and your renewal has priority over other people’s applications. But you never own the domain name.

Companies called registrars use domain name registries to keep track of technical and administrative information connecting you to your domain name.

Note: For some domain name, it might not be a registrar which is in charge of keeping track. For instance, every domain name under .fire is managed by Amazon.

Finding an available domain name

To find out whether a given domain name is available,

For example, if we visit GoDaddy (one of the world’s larget domain registrars) we can see a search bar that allows us to type in the domain that we want to register:

Ops! It seems that our supercooldomain.com is not currently available.

As you can see, I can’t register mozilla.org because the Mozilla Foundation has already registered it.

On the other hand, let’s see if I could register afunkydomainname.org:

whois afunkydomainname.org

This will output the following (at the time of writing):

NOT FOUND

As you can see, the domain does not exist in the whois database, so we could ask to register it. Good to know!

Getting a domain name

The process is quite straightforward:

  1. Go to a registrar’s website.

  2. Usually there is a prominent “Get a domain name” call to action. Click on it.

  3. Fill out the form with all required details. Make sure, especially, that you have not misspelled your desired domain name. Once it’s paid for, it’s too late!

  4. The registrar will let you know when the domain name is properly registered. Within a few hours, all DNS servers will have received your DNS information.

Note: In this process the registrar asks you for your real-world address. Make sure you fill it properly, since in some countries registrars may be forced to close the domain if they cannot provide a valid address.

DNS refreshing

DNS databases are stored on every DNS server worldwide, and all these servers refer to a few special servers called “authoritative name servers” or “top-level DNS servers” — these are like the boss servers that manage the system.

Whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every DNS database. Each DNS server that knows about a given domain stores the information for some time before it is automatically invalidated and then refreshed (the DNS server queries an authoritative server and fetches the updated information from it). Thus, it takes some time for DNS servers that know about this domain name to get the up-to-date information.

TIP: There are several online tools that enable you to check the process of DNS updating (also called propagation). In the screenshot below, you can see how DNSChecker provides a list of up-to-date DNS servers along with a nice map indicating all the DNS servers along with their status.

How does a DNS request work?

As we already saw, when you want to display a webpage in your browser it’s easier to type a domain name than an IP address. Let’s take a look at the process:

  1. Type mozilla.org in your browser’s location bar.

  2. Your browser asks your computer if it already recognizes the IP address identified by this domain name (using a local DNS cache). If it does, the name is translated to the IP address and the browser negotiates contents with the web server. End of story.

  3. If your computer does not know which IP is behind the mozilla.org name, it goes on to ask a DNS server, whose job is precisely to tell your computer which IP address matches each registered domain name.

  4. Now that the computer knows the requested IP address, your browser can negotiate contents with the web server.

Explanation of the steps needed to obtain the result to a DNS request

More Resources


Sources and Attributions

Content is based on the following sources:


Project maintained by in-tech-gration Hosted on GitHub Pages — Theme by mattgraham