Take a web address apart and meet the giant directory that turns names into IP addresses.
Open this lesson in KodokonA URL is the full address of a resource on the web. Like a postal address, it reads in pieces, from the most general to the most specific: the country, the city, the street, the number, the floor. Each piece of a URL has a name and a precise role, and being able to name them will serve you every single day.
https://en.wikipedia.org/wiki/HTML?action=history#History
protocol : https
domain : en.wikipedia.org
path : /wiki/HTML
parameters : ?action=history
fragment : #HistoryThe protocol (https) states which language the two machines are going to speak. The domain says which machine to talk to. The path points to the exact resource on that machine, just like a path through folders. The parameters, introduced by a question mark, pass information to the server (a search term, a page number). The fragment, introduced by a hash sign, is never sent to the server at all: it only tells the browser where to scroll on the page.
The domain name itself reads right to left. In en.wikipedia.org, the rightmost part, org, is the extension (also called the top-level domain). Then wikipedia is the name the organization bought. Finally en is a subdomain, which the owner is free to add to point at a particular machine or service. That is why wikipedia.org and en.wikipedia.org belong to the same owner, whereas wikipedia.org.example.net belongs to whoever owns example.net.
One problem: the network only understands IP addresses. So we need a directory able to translate wikipedia.org into 185.15.59.224. That worldwide directory is called DNS (Domain Name System). Before every visit, your machine queries a DNS server, gets the IP address back, and only then contacts the site. You can run that translation by hand.
dig +short wikipedia.org
185.15.59.224curl -s "https://example.com/page___id=12"