Oct 13, 2022
Each host on the Internet is assigned an IP address, which is used by the Internet layer of the TCP/IP model to route data packets to correct hosts
In the IPv4 version of the Internet Protocol, these consist of 4 bytes of numbers, often represented in a form like 134.53.7.196
While computers are adept at using numbers like these, humans prefer friendlier names to help identify hosts
A domain name is a text string that maps back to an IP address, so that we can refer to a host by its name instead of its IP address Domain names exist within a hierarchy
The number of top-level domains has increased over time
The Internet Assigned Numbers Authority maintains the list at http://www.iana.org/domains/root/db/ there are currently 1,591 registered domain root types.
Different organizations administer the top-level domains, with Internet Corporation for Assigned Names and Numbers (ICANN) administering the root and delegating authority out
Below the top-level domains are the second-level domains which are typically available for end-users to reserve/register.
Below the second-level domains, exist third-, fourth-, fifth-level, and so on which are managed by the domain owner
mymiami – specific purpose (www, mail, ftp, etc.)
miamioh – company/product
edu – top-level domain
Domain Name Registration is the process of getting a domain name added to the registry.
Users usually go through a registrar who has been authorized by the administering authority for a specific TLD which has been granted that authority by ICANN
Registry information is available by the WHOIS service, which is run by the TLD administrator
When you register a domain name, you don’t get “ownership” of the domain, you get an exclusive right/lease to use it.
That said, domain names can be very valuable, with some of the transfers earning several million dollars
In the early days of the Internet, there were so few hosts on the network that users maintained the domain name -> IP mapping in a hosts file on the machine
As time when on, the number of domains increased it became difficult to maintain these hosts files
At the end of 2021 there were approx 341.7 million domain name registrations
The Domain Name System (DNS) is the solution to unwieldy hosts files and provides a hierarchical but distributed system to resolve domain names to IP addresses
DNS is distributed, which means there is no one server that holds all of the details of all the domain names
However, the hierarchy maintains which name servers might know the answer.
Without any caching, the lookups would looks like this:
Querying from the root name servers to the TLD name servers to the second-level name servers and beyond is inefficient, so a cache is often used where each domain will specify a time-to-live (TTL) to specify how long the result should be cached
If a domain name is to be changed to a different IP, administrators will often shorten the TTL to a short value in advance of the change so that the new IP is resolved as quickly as possible after the change
DNS Record Types – different types of resource records are stored in DNS; Examples:
A web server can refer to the physical server or the software that runs on the server; we’ll often use the term to refer to the software
A web server’s primary responsibility is to deliver web content to clients via the HTTP protocol
Additionally, web servers often support running server side code like the JavaScript and the Express things like we are doing right now