C Domain Name

While you can use the free subdomain names like those provided by GitHub or Netlify, it may be a better idea to own a domain name of your own. The cost of an apex domain is minimal (typically the yearly cost is about US$10), and you will enter a much richer world after you purchase a domain name. For example, you are free to point your domain to any web servers, you can create as many subdomain names as you want, and you can even set up your own email accounts using the domain or subdomains. In this appendix, we will explain some basic concepts of domain names, and mention a few (free) services to help you configure your domain name.

Before we dive into the details, we want to outline the big picture of how a URL works in your web browser. Suppose you typed or clicked a link http://www.example.com/foo/index.html in your web browser. What happens behind the scenes before you see the actual web page?

First, the domain name has to be resolved through the nameservers associated with it. A nameserver knows the DNS (Domain Name System) records of a domain. Typically it will look up the “A records” to point the domain to the IP address of a web server. There are several other types of DNS records, and we will explain them later. Once the web server is reached, the server will look for the file foo/index.html under a directory associated with the domain name, and return its content in the response. That is basically how you can see a web page.