c2cedge
LibraryCS Fundamentals › Ch 14
CS Fundamentals · C — Computer Networks

Application Layer: HTTP, DNS & DHCP

The application layer is where the web lives. DNS, HTTP methods and status codes, and DHCP are practical, frequently-asked topics.

Test weight: HighAsked by: TCS, Infosys, web rolesDifficulty: Easy–Medium

The application layer holds the protocols users interact with. DNS turns names into IP addresses, HTTP carries web requests and responses, and DHCP automatically hands out IP addresses to devices joining a network. These three power almost everything you do online.

DNS, HTTP, DHCP at a glance

DNS is the internet's phone book — it resolves a domain (example.com) to an IP. HTTP is the request/response protocol of the web, using methods (GET, POST...) and status codes (200, 404...). DHCP automatically assigns a device its IP, subnet mask, gateway and DNS server when it joins a network.

HTTP methods & status codes

ItemMeaning
GETretrieve data (no side effects)
POSTsubmit/create data
PUT / DELETEupdate / remove a resource
2xxsuccess (200 OK)
3xxredirect (301 moved)
4xxclient error (404 not found)
5xxserver error (500)
⚡ The edge
  • Status codes by first digit: 2xx success, 3xx redirect, 4xx your fault (client), 5xx server's fault. That single rule decodes most codes.
  • HTTP is stateless — each request is independent; cookies, sessions and tokens are how applications add state on top.
Worked example
'What is the difference between GET and POST?'
  1. GET retrieves data and puts parameters in the URL; it should have no side effects and is cacheable/bookmarkable.
  2. POST submits data in the request body, is used to create/change state, and is not cached.
  3. So GET is for reading, POST is for writing — and sensitive data shouldn't ride in a GET URL.
Worked example
'What is DNS and what happens on a lookup?'
  1. DNS maps human-readable domains to IP addresses.
  2. On a lookup, the resolver checks caches, then queries the root, the TLD (.com) server, and the authoritative server in turn.
  3. It returns the IP, which the browser then uses to open a connection — all usually in milliseconds.
⚠ Watch out
  • HTTP is stateless; state (login, cart) is added via cookies/sessions/tokens, not the protocol itself.
  • A 404 is a client-side 'not found' (4xx); a 500 is a server error (5xx) — don't blame the wrong side.
  • HTTPS is HTTP over TLS (encryption) — same methods, secured transport.
Practice this — take a timed mock →
1,300+ questions, scored, with a weak-area report.
Know who's ready. Not who finished.
HomeLibraryPrivacyTerms