Internet Basics â How the Web Works, Browsers, URLs & DNS
Learn how the internet works: web browsers, URLs explained, DNS resolution, HTTP requests, and how data travels from your device to websites and back again.
What You'll Learn
By the end of this tutorial, you will understand what happens when you type a web address into a browser, what each part of a URL means, and how DNS turns names into numbers.
Why It Matters
The internet powers everything we do as programmers. Whether you are building a website, calling an API, or downloading packages with a tool, understanding the basics helps you diagnose problems and build better software.
Real-World Use
Doda Browser handles thousands of DNS lookups and HTTP requests every session. When a page loads slowly, knowing whether the issue is DNS, the server, or your network connection helps you fix it faster.
Your Learning Path
flowchart LR
A[Computer Basics] --> B[Internet Basics]
B --> C[First HTML Page]
C --> D[Dev Environment Setup]
D --> E[First Project]
B --> F{You Are Here}
style F fill:#f90,color:#fff
Prerequisites: Basic computer skills from the Basic Computer Skills tutorial. No prior internet knowledge needed.
What Is the Internet?
The internet is a global network of computers connected by cables, wireless signals, and satellites. Think of it like a postal system. Your computer is your house. Websites are buildings in other cities. Data packets are letters that travel between them.
When you visit a website, your computer sends a request (a letter) to the website's computer (a server). The server sends back the webpage (a reply letter).
What Is a Web Browser?
A web browser is the program you use to visit websites. Common browsers include Chrome, Firefox, Safari, Edge, and Doda Browser.
The browser's job is to:
- Accept the web address you type
- Find the server for that address
- Request the webpage
- Display the page on your screen
Understanding URLs
A URL (Uniform Resource Locator) is the address of a webpage. It looks like this:
https://www.example.com:443/products/page.html?search=shoes#reviews
Let us break each part down:
| Part | Example | What It Does |
|---|---|---|
| Protocol | https:// |
The rules for communication. HTTPS is secure HTTP. |
| Subdomain | www |
A specific section of the website |
| Domain | example.com |
The website's unique name |
| Port | :443 |
The door number on the server (default: 80 for HTTP, 443 for HTTPS) |
| Path | /products/page.html |
The specific page or file on the server |
| Query | ?search=shoes |
Extra parameters sent to the server |
| Fragment | #reviews |
A specific section on the page |
Most URLs do not show every part. When you type example.com, the browser fills in https:// and :443 automatically.
How DNS Works
DNS stands for Domain Name System. It is the phonebook of the internet. Computers communicate using numbers called IP addresses. But humans remember names better than numbers.
When you type example.com, the browser asks DNS: "What is the IP address for example.com?" DNS responds with something like 93.184.216.34. The browser then connects to that IP.
import socket
def resolve_domain(domain):
try:
ip = socket.gethostbyname(domain)
return ip
except socket.gaierror:
return None
domains = ["example.com", "google.com", "github.com"]
for d in domains:
ip = resolve_domain(d)
print(f"{d} -> {ip}")
Expected output:
example.com -> 93.184.216.34
google.com -> 142.250.80.46
github.com -> 140.82.121.3
How HTTP Requests Work
When the browser knows the server's IP, it sends an HTTP request. Think of this as the browser saying: "Hello server, please send me the page at /products/page.html."
import urllib.request
url = "https://httpbin.org/get"
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
print(f"Status code: {response.status}")
print(f"Content-Type: {response.headers.get('Content-Type')}")
data = response.read().decode()
print(f"Response length: {len(data)} characters")
Expected output (approximate):
Status code: 200
Content-Type: application/json
Response length: 350 characters
A status code of 200 means "OK." Other common codes are 404 (not found) and 500 (server error).
How Your Browser Displays a Page
When the browser receives the HTML file, it goes through these steps:
- Parse the HTML to understand the page structure
- Fetch any additional files (CSS for styling, images, JavaScript)
- Build the visual layout (the Document Object Model)
- Render everything on your screen
This whole process usually takes less than one second.
Common Mistakes Beginners Make
1. Confusing the Internet and the Web
The internet is the network of connected computers. The web is the collection of pages you access through that network. Email, online gaming, and file transfers also use the internet but are not the web.
2. Forgetting HTTPS
Always look for https:// before entering personal information. The S means the connection is encrypted. Sites without HTTPS are not secure.
3. Typing URLs Incorrectly
A single typo in a URL takes you to a different site or causes an error. Type carefully. gooogle.com (with three o's) is not the same as google.com.
4. Not Using Bookmarks
Memorizing URLs is unnecessary. Use browser bookmarks to save pages you visit often. Most browsers let you organize bookmarks into folders.
5. Ignoring Browser Developer Tools
Right-click any webpage and select "Inspect" to open developer tools. You can see the HTML, CSS, network requests, and console messages. This is invaluable for debugging.
6. Not Understanding the Address Bar
The address bar also works as a search bar. But be careful: typing a search term there sends it to your default search engine, not directly to a website. To go to a specific site, type the full URL.
7. Opening Too Many Tabs
Each open tab uses memory. Having 50 tabs open slows your computer significantly. Bookmark pages for later and close tabs you are done with.
Practice Questions
1. What does DNS do? DNS translates human-readable domain names (like example.com) into IP addresses that computers use to communicate.
2. What is the difference between HTTP and HTTPS? HTTPS is HTTP with encryption (SSL/TLS). HTTPS protects your data from being read by others while it travels across the internet.
3. What does a 404 status code mean? The requested page was not found on the server. Either the URL is wrong or the page has been removed.
4. What is a URL fragment used for? The fragment (the part after #) scrolls the browser to a specific section on the page. It is not sent to the server.
5. Challenge: Open your browser's developer tools (right-click, Inspect), go to the Network tab, and reload this page. Find the first request. What is its status code? You are now looking at real HTTP requests, just like professional web developers.
Try It Yourself
Open a new browser tab and type whatsmyip.org. Your browser will show your public IP address. Try visiting the same site from your phone on Wi-Fi. The IP will be different because your phone connects through a different network.
This is the same technology that Doda Browser uses to connect you to websites securely every time you open a new tab.
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro