Skip to content
Know.itKnow.it
Create an animated lesson
On request

This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.

How does a URL work?

TechnologyLesson on requestFree to read

Quick answer

A URL is the address of a resource on the internet. It begins with a protocol like https, followed by a domain name that DNS converts to a server's IP address, then a path to the specific file, and optional query data. The browser uses these parts to request and display the correct content.

A URL is a text address that identifies a resource on the internet and tells your browser how to fetch it. It combines a protocol, a domain name, and a path so computers can locate and request the right file or page.

Step by step

  1. You type or click a URL, and the browser splits it into scheme, domain, path, and query.
  2. The browser uses DNS to translate the domain name into the IP address of a server.
  3. It opens a connection to that server and sends an HTTP request for the path and query.
  4. The server processes the request and returns the requested resource, such as an HTML page.
  5. The browser renders the response, displaying the page or file you asked for.

Key things to understand

  1. A URL starts with a scheme like https, which tells the browser which protocol to use for the request.
  2. The domain name, such as example.com, is translated by DNS into a numeric IP address of a server.
  3. The path, like /articles/url, points to a specific resource or page on that server.
  4. A query string after a question mark sends extra data, such as search terms or page numbers.
  5. The browser sends an HTTP request to the server, which returns the resource for display.

Labelled diagram

  1. Scheme

    https tells the browser to use secure HTTP for the request.

  2. Domain

    example.com is looked up by DNS to find the server's IP address.

  3. Path

    /articles/url points to a specific file or page on that server.

  4. Query

    ?q=hello sends extra data, like a search term, to the server.

Parts of a URL

Real-world examples

  • Typing https://www.wikipedia.org/wiki/URL into a browser loads the Wikipedia article on URLs.
  • A search result link like https://www.google.com/search?q=weather sends your query to Google's server.
  • Scanning a QR code on a poster opens a URL such as https://example.com/event that loads an event page.
  • Clicking an email link like https://mail.example.com/inbox/123 opens a specific message in your webmail.

Common mistake

✗ Myth: A URL is the same as a domain name.

✓ Fact: A domain name is only one component of a URL. A URL also includes the protocol, path, and possibly a query string, which together specify exactly how and what to fetch.

People also ask

What happens when you type a URL?
The browser parses the URL into its parts. It uses DNS to find the server's IP address, opens a connection, and sends an HTTP request for the path. The server responds with the resource, and the browser renders it on your screen.
How does dns work with urls?
DNS, the Domain Name System, translates a human-readable domain like example.com into a numeric IP address. The browser sends the domain to a DNS resolver, which queries other servers until it finds the matching IP, then returns it to the browser.
What is a query string in a url?
A query string is the part of a URL after a question mark. It carries extra data as key-value pairs, such as ?q=hello&page=2. Servers use this data to customize the response, like showing search results or a specific page.
What is the difference between a URL and a domain name?
A domain name is just one part of a URL, identifying the server, like example.com. A URL is the complete address, including the protocol, path, and optional query, that tells the browser exactly what to fetch.
What does HTTPS mean in a URL?
HTTPS is the secure version of the HTTP protocol. It encrypts the data exchanged between your browser and the server, so passwords and messages cannot be easily read or altered by others on the network.
Can a URL work without www?
Yes. The www is just a conventional subdomain, not a required part. Many sites work with or without it, and the server can be configured to redirect one to the other automatically.
What happens if I type a URL with a typo?
The browser asks DNS to look up the misspelled domain. If no server matches, DNS returns an error and the browser shows a 'server not found' page. Some typos may lead to different, unrelated sites.

Part of the guide: How the Internet Works →