CIE AS & A Level Computer Science, section 2.1 (Networks including the internet)
Uniform Resource Locator (URL)
A URL is the full address of a resource on the web. It has parts:
https://www.example.com/news/today.html
- Protocol:
https(how the resource will be accessed). - Domain name:
www.example.com(the server). - Path (and file name):
/news/today.html(the resource on the server).
Why domain names?
People remember names more easily than numbers, so websites have domain names. The computer needs the IP address, so the name must be translated.
Domain Name Service (DNS)
The DNS is a system of servers that holds a database linking domain names to IP addresses.
How a page is found
- The user types the URL in the browser.
- The browser asks a DNS server (provided by the ISP) for the IP address of the domain name.
- If that server does not know it, the request passes to other DNS servers (such as the root and top-level domain servers) until the address is found.
- The IP address is returned to the browser.
- The browser sends an HTTP request to the web server at that IP address, and the server sends back the page.
The browser and the DNS server may cache the result, so later requests are faster.
Common mistake: saying DNS "stores the web pages". It stores only the mapping from names to IP addresses. Also, the URL is more than the domain name: it includes the protocol and the path.
Exam tip: describe the sequence: browser asks the DNS server, DNS returns the IP address, the browser requests the page from the web server. Name the three parts of a URL.
Check yourself
What are the three main parts of a URL?
The protocol, the domain name and the path (file name).
What does a DNS server do?
It translates a domain name into the IP address of the web server.
Why is the IP address needed after DNS look-up?
The browser needs the address to send the request to the correct web server.