codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🌐

Computer Networks

26 chapters

1Network Topologies & LAN/WAN2Network Devices (Hub, Switch, Router)3OSI Reference Model4OSI Model & TCP/IP Suite5TCP/IP Protocol Suite6Switching Techniques (Circuit, Packet)7Data Link: Framing & Error Detection8Error Correction (Hamming Code)9Flow Control (Stop-and-Wait, Sliding Window)10MAC: CSMA/CD & CSMA/CA11Network Layer & Routing12IP Addressing (IPv4, IPv6)13Subnetting & CIDR14Routing Algorithms (Distance Vector, Link State)15ARP, ICMP, and NAT16DHCP Protocol17Transport Layer Services18Transport Layer: UDP19Transport Layer: TCP & 3-Way Handshake20TCP Congestion Control21Application Layer: DNS & HTTP22Application Layer: SMTP & FTP23Socket Programming Basics24Wireless Networks & Wi-Fi Standards25VLANs & Spanning Tree Protocol26Network Security & Cryptography
SubjectsComputer Networks

Application Layer: DNS & HTTP

Updated 2026-05-03
3 min read

Application Layer: DNS & HTTP

The Application Layer is the top layer of the TCP/IP suite. It contains the high-level protocols that user applications (like web browsers) use to communicate across the network. The two most fundamental protocols for web browsing are DNS and HTTP.

1. DNS (Domain Name System)

Humans are terrible at memorizing random numbers. If you want to visit Google, you don't type 142.250.190.46 into your browser; you type google.com.

However, routers only understand IP addresses. The Domain Name System (DNS) is a massive, globally distributed database that acts as the phonebook of the Internet, translating human-readable domain names into machine-readable IP addresses.

How a DNS Resolution Works:

When you type codingstuff.io in your browser:

  1. Local Cache: The browser checks its internal cache and the OS cache. If the IP is there, it uses it instantly.
  2. DNS Resolver: If not cached, the OS asks a Recursive DNS Resolver (usually provided by your ISP or a public one like Google's 8.8.8.8).
  3. Root Server: The resolver contacts one of the 13 global Root Name Servers. The root server doesn't know the exact IP, but it knows who handles .io domains.
  4. TLD Server: The resolver asks the Top-Level Domain (TLD) server for .io. The TLD server responds with the address of the specific Authoritative Name Server for codingstuff.io.
  5. Authoritative Server: The resolver finally asks the Authoritative server, which returns the exact IP address.
  6. The resolver caches this IP and returns it to your browser.

(Note: Because speed is critical, DNS primarily uses the lightweight UDP protocol on Port 53).

2. HTTP (HyperText Transfer Protocol)

Once the browser has the IP address, it establishes a TCP connection to that server (Port 80 for HTTP, Port 443 for HTTPS). It then uses HTTP to request the web page.

HTTP is a Stateless, Request-Response protocol.

  • Stateless: The server does not retain any memory of previous requests. (This is why cookies were invented—to allow servers to remember who you are).

HTTP Request

A client sends an HTTP request message. It consists of:

  1. Method: The action to be performed (GET to fetch data, POST to submit a form, PUT, DELETE).
  2. URI: The specific resource path (e.g., /index.html).
  3. Headers: Key-value pairs providing metadata (e.g., User-Agent: Mozilla/5.0, Accept-Language: en-US).
  4. Body: Optional data (used in POST/PUT requests).

HTTP Response

The server processes the request and sends an HTTP response message. It consists of:

  1. Status Code: A 3-digit number indicating success or failure.
    • 200 OK: Request succeeded.
    • 301 Moved Permanently: Redirect.
    • 403 Forbidden: You don't have permission.
    • 404 Not Found: The resource doesn't exist.
    • 500 Internal Server Error: The server's backend code crashed.
  2. Headers: Server metadata (e.g., Content-Type: text/html).
  3. Body: The actual HTML file or JSON data requested.

HTTPS (HTTP Secure)

Standard HTTP sends all data in plain text. Anyone intercepting the network traffic can read your passwords. HTTPS uses TLS/SSL encryption to wrap the HTTP data in a mathematically unbreakable cryptographic tunnel before it leaves your computer.



PreviousTCP Congestion ControlNextApplication Layer: SMTP & FTP

Recommended Gear

TCP Congestion ControlApplication Layer: SMTP & FTP