What Happens When You Type a URL: DNS, HTTP and HTTPS
You type a web address, press Enter, and a page appears in about a second. In that second, your browser finds the right computer somewhere in the world, asks it for the page, checks the connection is safe and draws everything on your screen.
This lesson walks through each step in plain words: URLs, DNS, HTTP and the padlock of HTTPS.
What You'll Learn
- The parts of a URL and what each one means
- How DNS turns a name like freeacademy.ai into an IP address
- What HTTP is and how a browser asks for a page
- What HTTPS and the padlock protect, and what they do not
The parts of a URL
A URL is the full address of something on the web. Take this example:
https://www.example.com/courses/python?lang=en
| Part | Example | What it means |
|---|---|---|
| Scheme | https:// | The rule to use. HTTPS means a secure connection |
| Domain name | www.example.com | The name of the website |
| Path | /courses/python | Which page on that website |
| Query | ?lang=en | Extra details, like a language or a search word |
The domain name is read from right to left. In www.example.com, the .com part is the top-level domain. example is the name someone registered. www is a part of that site. Other top-level domains include .org, .in, .ai and many more.
DNS: the internet's contact list
Computers find each other using IP addresses, like 203.0.113.25. People are bad at remembering numbers like that. So we use names, and a system called DNS (Domain Name System) turns names into numbers.
DNS works like the contacts list on your phone. You tap "Mom", and your phone looks up the number for you. You type a website name, and DNS looks up its IP address.
There is no single giant list. DNS is spread across many servers around the world, each responsible for its own part:
- Your deviceChecks if it already knows the address from a recent visit
- ResolverA DNS server, often run by your internet provider, takes the question
- Root and .com serversPoint the resolver to the servers in charge of this name
- The site's DNS serverGives the final answer: the IP address
- Saved for laterThe answer is kept for a while, so the next visit is faster
Saving answers for later is called caching. Because of it, most lookups take only a few milliseconds.
When a site "cannot be found", the problem is often DNS. Either the name was typed wrong, or the DNS server could not give an answer.
Connecting to the server
Now your browser knows the IP address. It opens a connection to the server, the computer that holds the website. Your request travels as packets through routers, exactly as you saw in the last lesson.
If the address starts with https://, the browser and server first agree on a secret way to scramble their messages. More on that below.
HTTP: asking for the page
Once connected, the browser and server talk using HTTP (Hypertext Transfer Protocol). HTTP is a simple pattern of request and response, like ordering at a counter.
- The browser sends a request: "Please give me the page /courses/python."
- The server sends a response: a short status line that says whether it worked, followed by the page itself.
You have probably seen one famous response: 404 Not Found. It means the server is working, but the page you asked for does not exist there. Developers use many other codes too. The course REST API Design covers them if you want to go further.
One page, many requests
A web page is not one file. It is a set of files that work together:
| File type | Job | Simple picture |
|---|---|---|
| HTML | The content and structure: headings, text, links | The walls and rooms of a house |
| CSS | The look: colors, fonts, layout | The paint and furniture |
| JavaScript | The behavior: buttons, menus, live updates | The electricity that makes things work |
| Images, video, fonts | The media | The pictures on the walls |
The browser first gets the HTML. While reading it, it finds links to the CSS, JavaScript and images, and asks for each one. A single page can need dozens of requests. Then the browser puts everything together and draws it on your screen.
If you want to see what HTML looks like, try HTML Fundamentals.
The full trip, from Enter to page
- Type the URLYou press Enter in the browser
- DNS lookupThe name becomes an IP address
- ConnectThe browser connects to the server, and sets up encryption for HTTPS
- HTTP requestThe browser asks for the page
- ResponseThe server sends back HTML, then the other files
- Draw the pageThe browser builds and shows the page
All of this usually happens in well under a second.
HTTPS and the padlock
With plain HTTP, your messages travel as readable text. Anyone on the path, such as someone on the same public Wi-Fi, could read or change them.
HTTPS adds encryption. Before any page is sent, the browser and server agree on a secret key. After that, everything is scrambled so only the two of them can read it. The browser also checks a certificate, a kind of digital ID card that proves the server really belongs to that domain name.
When this all works, your browser shows a padlock or a similar secure icon next to the address.
Today almost every serious website uses HTTPS.
| Criteria | HTTP | HTTPS |
|---|---|---|
| Messages on the way | Readable by anyone on the path | Scrambled, only you and the site can read them |
| Proves the site's identity | No | Yes, with a certificate |
| Safe for passwords and payments | No | Yes, if the site itself is real |
| Browser shows | A warning or 'Not secure' | A padlock or secure icon |
HTTP
- Messages on the way
- Readable by anyone on the path
- Proves the site's identity
- No
- Safe for passwords and payments
- No
- Browser shows
- A warning or 'Not secure'
HTTPS
- Messages on the way
- Scrambled, only you and the site can read them
- Proves the site's identity
- Yes, with a certificate
- Safe for passwords and payments
- Yes, if the site itself is real
- Browser shows
- A padlock or secure icon
What the padlock does not mean
This is important. The padlock means the connection is private. It does not mean the website is honest.
Scammers can get a certificate too. A fake site at y0urbank-login.com can show a padlock and still steal your password. Always check the domain name carefully, letter by letter, before you type a password or card number. If a message pushes you to log in fast, open the site yourself instead of tapping the link.
Key Takeaways
- A URL has a scheme, a domain name, a path and sometimes a query.
- DNS turns a name like example.com into an IP address, like a phone's contact list.
- HTTP is a request and response pattern. 404 means the page was not found.
- A web page is many files: HTML for content, CSS for looks, JavaScript for behavior, plus images.
- HTTPS encrypts the connection and proves the server's identity with a certificate.
- The padlock means the connection is private, not that the site is trustworthy. Always check the domain name.
Quiz
Up next ยท Lesson 6 of 6
The Cloud, Servers and How AI Tools Like ChatGPT Run
5 min read
5 of 6 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

