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

DNS: How Names Become IPs

A, AAAA, CNAME, MX, TXT records explained. Debug DNS issues. Configure a custom domain.

DNS Record Types

Record types
A      → name → IPv4 address
       example.com.  A  93.184.216.34

AAAA   → name → IPv6 address

CNAME  → alias → canonical name
       www  CNAME  example.com.

MX     → mail exchange server
       @  MX  10  mail.example.com.

TXT    → arbitrary text
       @ TXT  'v=spf1 include:_spf.google.com ~all'
       @ TXT  'google-site-verification=abc123'

NS     → nameserver for this domain

TTL    → time-to-live: how long to cache the record (seconds)
Debugging DNS
# Basic lookup
dig example.com
nslookup example.com

# Specific record type
dig example.com MX
dig example.com TXT
dig www.example.com CNAME

# Authoritative nameserver
dig example.com NS

# Trace the full resolution
dig +trace example.com

# Check propagation (different DNS servers)
dig @8.8.8.8 example.com    # Google DNS
dig @1.1.1.1 example.com    # Cloudflare DNS
dig @9.9.9.9 example.com    # Quad9 DNS
💡
DNS changes take time to propagate because of TTL. If you change a record with TTL=3600 (1 hour), some users might still get the old IP for up to an hour. Set TTL to 300 (5 min) before making changes. Restore to 3600 after.
📝 Day 4 Exercise
Configure DNS for a Domain
  1. I
  2. f
  3. y
  4. o
  5. u
  6. h
  7. a
  8. v
  9. e
  10. a
  11. d
  12. o
  13. m
  14. a
  15. i
  16. n
  17. :
  18. c
  19. h
  20. e
  21. c
  22. k
  23. a
  24. l
  25. l
  26. i
  27. t
  28. s
  29. r
  30. e
  31. c
  32. o
  33. r
  34. d
  35. s
  36. w
  37. i
  38. t
  39. h
  40. d
  41. i
  42. g
  43. .
  44. F
  45. i
  46. n
  47. d
  48. t
  49. h
  50. e
  51. A
  52. r
  53. e
  54. c
  55. o
  56. r
  57. d
  58. ,
  59. M
  60. X
  61. r
  62. e
  63. c
  64. o
  65. r
  66. d
  67. s
  68. ,
  69. a
  70. n
  71. d
  72. a
  73. n
  74. y
  75. T
  76. X
  77. T
  78. r
  79. e
  80. c
  81. o
  82. r
  83. d
  84. s
  85. (
  86. S
  87. P
  88. F
  89. ,
  90. D
  91. M
  92. A
  93. R
  94. C
  95. )
  96. .
  97. C
  98. h
  99. a
  100. n
  101. g
  102. e
  103. a
  104. T
  105. X
  106. T
  107. r
  108. e
  109. c
  110. o
  111. r
  112. d
  113. a
  114. n
  115. d
  116. v
  117. e
  118. r
  119. i
  120. f
  121. y
  122. p
  123. r
  124. o
  125. p
  126. a
  127. g
  128. a
  129. t
  130. i
  131. o
  132. n
  133. .
  134. I
  135. f
  136. n
  137. o
  138. d
  139. o
  140. m
  141. a
  142. i
  143. n
  144. :
  145. r
  146. u
  147. n
  148. d
  149. i
  150. g
  151. +
  152. t
  153. r
  154. a
  155. c
  156. e
  157. o
  158. n
  159. 3
  160. d
  161. i
  162. f
  163. f
  164. e
  165. r
  166. e
  167. n
  168. t
  169. d
  170. o
  171. m
  172. a
  173. i
  174. n
  175. s
  176. a
  177. n
  178. d
  179. e
  180. x
  181. p
  182. l
  183. a
  184. i
  185. n
  186. e
  187. a
  188. c
  189. h
  190. s
  191. t
  192. e
  193. p
  194. .

Day 4 Summary

  • A record → IPv4. AAAA → IPv6. CNAME → alias. MX → email routing. TXT → verification and SPF.
  • TTL controls caching. Low TTL = faster propagation but more DNS queries.
  • dig +trace domain shows every DNS hop from root to authoritative nameserver.
  • Always lower TTL before DNS changes. Restore it after.
Finished this lesson?