Day 1 of 5
⏱ ~60 minutes
Networking for Developers — Day 1

How the Internet Works

Trace exactly what happens when you type a URL and press Enter — every step from DNS lookup to rendered HTML.

The Full Request Journey

Most developers use the internet every day and can't explain how it works. This matters because understanding the journey helps you debug connection failures, DNS issues, and slow page loads.

The 7-step journey
1. You type: https://github.com
2. DNS lookup: 'What IP is github.com?'
   → Resolver queries root → TLD → authoritative DNS
   → Returns: 140.82.112.3
3. TCP handshake to 140.82.112.3:443
   → SYN → SYN-ACK → ACK
4. TLS handshake (HTTPS)
   → Exchange certificates
   → Agree on encryption
5. HTTP GET / request sent
6. Server processes request
7. HTTP 200 response with HTML
   → Browser parses HTML
   → Fetches CSS, JS, images
   → Renders the page
DNS in the terminal
# See DNS resolution
dig github.com
nslookup github.com

# Trace the full DNS path
dig +trace github.com

# Check what DNS server you're using
cat /etc/resolv.conf
nscurl -s https://dns.google/resolve?name=github.com | python3 -m json.tool
💡
When a site won't load, your first question should be: 'Is this a DNS issue or a connection issue?' Run dig github.com. If it returns an IP, DNS is working. Then try curl -v https://github.com to test the connection.
📝 Day 1 Exercise
Trace a Request
  1. P
  2. i
  3. c
  4. k
  5. 3
  6. w
  7. e
  8. b
  9. s
  10. i
  11. t
  12. e
  13. s
  14. .
  15. F
  16. o
  17. r
  18. e
  19. a
  20. c
  21. h
  22. :
  23. r
  24. u
  25. n
  26. d
  27. i
  28. g
  29. t
  30. o
  31. g
  32. e
  33. t
  34. t
  35. h
  36. e
  37. I
  38. P
  39. ,
  40. v
  41. e
  42. r
  43. i
  44. f
  45. y
  46. w
  47. i
  48. t
  49. h
  50. c
  51. u
  52. r
  53. l
  54. -
  55. v
  56. ,
  57. l
  58. o
  59. o
  60. k
  61. a
  62. t
  63. t
  64. h
  65. e
  66. h
  67. e
  68. a
  69. d
  70. e
  71. r
  72. s
  73. r
  74. e
  75. t
  76. u
  77. r
  78. n
  79. e
  80. d
  81. .
  82. F
  83. i
  84. n
  85. d
  86. o
  87. n
  88. e
  89. t
  90. h
  91. a
  92. t
  93. u
  94. s
  95. e
  96. s
  97. a
  98. C
  99. D
  100. N
  101. (
  102. h
  103. i
  104. n
  105. t
  106. :
  107. c
  108. h
  109. e
  110. c
  111. k
  112. t
  113. h
  114. e
  115. S
  116. e
  117. r
  118. v
  119. e
  120. r
  121. h
  122. e
  123. a
  124. d
  125. e
  126. r
  127. )
  128. .
  129. E
  130. x
  131. p
  132. l
  133. a
  134. i
  135. n
  136. w
  137. h
  138. a
  139. t
  140. y
  141. o
  142. u
  143. s
  144. e
  145. e
  146. .

Day 1 Summary

  • DNS translates names to IPs. Every request starts with a DNS lookup unless it's cached.
  • TCP handshake: SYN → SYN-ACK → ACK. Three packets before any data is exchanged.
  • TLS adds encryption on top of TCP. Happens before the HTTP request.
  • dig, nslookup, curl -v are the three tools for diagnosing network issues.
Finished this lesson?