You type a URL, hit Enter, and a webpage loads instantly.
But behind that simple action lies a complex chain of events involving DNS, networking, routing, and security mechanisms.
This article explains about how exactly the request sent from your computer in your LAN reaches the server and how the response is visible on your screen.
- User enters the URL in the browser.
- Browser checks it's own cache for the IP address.
- If not found, the OS DNS cache is checked.
- If still not found, the DNS query is sent to a recursive DNS resolver.
- The DNS resolver then checks its cache.
- If not found, the DNS resolution process begins.
In the DNS resolution process :-
- The DNS query reaches the DNS resolver and it checks its cache.
- If not found, it queries the Root DNS server.
- The Root DNS server points to the Top Level Domain(TLD) DNS server.
- The TLD DNS server then points out to the Authoritative server, where the IP address of the domain is found.
- The resolver caches the IP address and sends it back to the system.
- The system now has the destination IP address.
- It checks the routing table and decides to send the packet via the default gateway(router).
- System needs the MAC address of the router (next hop).
- It checks ARP cache.
- If not found, it sends ARP broadcast.
- Router replies with its MAC address.
- System creates the packet :-
- Source IP = private IP
- Destination IP = server IP
- Destination MAC = router MAC
The packet is sent to the router.
- Router receives the packet.
- Router performs NAT (private IP to public IP).
- Router performs PAT and then assigns a unique port.
- Entry is stored in NAT/PAT table.
- The packet travels through internet via multiple routers.
- It Reaches the destination server.
- Server processes the request and sends response back to public IP + port.
- Router receives the response.
- Router checks NAT/PAT table.
- The router maps the public IP + port to the correct private IP + port.
- Router checks ARP cache for internal device MAC.
- If not found it then performs ARP.
- Router sends the packet to the correct device.
- Device receives the response.
- Browser processes and then finally renders the webpage.
Although this entire flow happens within milliseconds, it exposes multiple points where attackers can intercept, manipulate, or redirect traffic.
Potential Attacks :-
1. DNS Spoofing
Attacker returns a fake IP instead of the real one.
During DNS resolution, the user thinks they are visiting real site. Actually redirected to malicious server.
2. ARP Poisoning
Attacker sends fake ARP responses to become βrouterβ during the ARP resolution in local network. The traffic gets intercepted
attacker becomes man-in-the-middle.
3. Man-in-the-Middle (MITM)
Attacker intercepts communication between client and server. During the data transmission the data can be read or modified.
4. Port Scanning
Attacker scans open ports before attacking before connection. The
attacker finds services like Port 22 (SSH), Port 80 (HTTP), Port 443 (HTTPS).
This process is not just about how systems communicate, but where they can fail. Each step in the flow represents a potential attack surface, making it critical to understand, monitor, and defend these points effectively.



Top comments (1)
Super clean breakdown π β once you actually trace DNS β ARP β NAT like this, you realize most βit just worksβ moments are full of attack surfaces. Learned this the hard way debugging a weird DNS cache issue π