1- # DNS in Detail – Study Notes
1+ ---
2+ type : resource-note
3+ status : done
4+ created : 2026-03-11
5+ updated : 2026-03-11
6+ tags : [security-writeup, tryhackme, dns, web]
7+ source : TryHackMe - DNS in Detail
8+ platform : tryhackme
9+ room : DNS in Detail
10+ slug : dns-in-detail
11+ path : TryHackMe/10-web/how-the-web-works/01-DNS-in-detail.md
12+ topic : 10-web
13+ domain : [web, dns]
14+ skills : [dns, caching, name-resolution]
15+ artifacts : [concept-notes]
16+ sanitized : true
17+ ---
18+
19+ # DNS in Detail
220
321Room: ` DNS in Detail ` (TryHackMe)
422
523---
624
7- ## 0. Big Picture
25+ ## Summary
826
927DNS (Domain Name System) = ** Internet phonebook** .
1028
@@ -24,7 +42,9 @@ Core ideas:
2442
2543---
2644
27- ## 1. Domain Hierarchy
45+ ## Key Concepts
46+
47+ ### 1. Domain Hierarchy
2848
2949A domain is structured from ** right to left** .
3050
@@ -37,12 +57,12 @@ jupiter.servers.tryhackme.com.
3757 └── jupiter # Subdomain level 2 (host)
3858```
3959
40- ### 1.1 Root
60+ #### 1.1 Root
4161
4262* Written as ` . ` but usually ** omitted** in everyday use.
4363* Served by a small set of ** root DNS servers** – DNS “backbone”.
4464
45- ### 1.2 TLD – Top‑Level Domain
65+ #### 1.2 TLD – Top‑Level Domain
4666
4767Right‑most visible label, e.g. ` .com ` , ` .org ` , ` .edu ` , ` .gov ` , ` .mil ` , ` .uk ` , ` .io ` .
4868
@@ -58,7 +78,7 @@ Two main classes:
5878
5979> Example: ` .co.uk ` → ** ccTLD** (country‑code top‑level domain).
6080
61- ### 1.3 Second‑Level Domain (SLD)
81+ #### 1.3 Second‑Level Domain (SLD)
6282
6383* The part ** left of the TLD** , e.g. ` tryhackme ` in ` tryhackme.com ` .
6484* Combined with TLD to form the “base domain”.
@@ -69,7 +89,7 @@ Two main classes:
6989 * Cannot ** start** or ** end** with ` - `
7090 * Cannot contain consecutive ` -- ` in some reserved cases (IDN punycode).
7191
72- ### 1.4 Subdomains
92+ #### 1.4 Subdomains
7393
7494* Any label(s) ** to the left** of the SLD.
7595
@@ -81,11 +101,11 @@ Two main classes:
81101
82102---
83103
84- ## 2. DNS Record Types (Core)
104+ ### 2. DNS Record Types (Core)
85105
86106Each domain can have multiple ** resource records** .
87107
88- ### 2.1 A Record (Address)
108+ #### 2.1 A Record (Address)
89109
90110* Maps name → ** IPv4** address.
91111* Example:
@@ -94,15 +114,15 @@ Each domain can have multiple **resource records**.
94114tryhackme.com. IN A 104.26.10.229
95115```
96116
97- ### 2.2 AAAA Record (Quad‑A)
117+ #### 2.2 AAAA Record (Quad‑A)
98118
99119* Maps name → ** IPv6** address.
100120
101121``` text
102122example.com. IN AAAA 2001:db8:85a3::8a2e:370:7334
103123```
104124
105- ### 2.3 CNAME Record (Canonical Name)
125+ #### 2.3 CNAME Record (Canonical Name)
106126
107127* Alias: maps ** name → another name** , not directly to IP.
108128* Client must then resolve the ** target name** .
@@ -112,7 +132,7 @@ example.com. IN AAAA 2001:db8:85a3::8a2e:370:7334
112132store.tryhackme.com. IN CNAME shops.shopify.com.
113133```
114134
115- ### 2.4 MX Record (Mail Exchange)
135+ #### 2.4 MX Record (Mail Exchange)
116136
117137* Tells the world ** which mail server(s)** handle email for this domain.
118138* Includes ** priority** (lower number = higher priority).
@@ -125,7 +145,7 @@ tryhackme.com. IN MX 20 alt2.aspmx.l.google.com.
125145> Q: * What record type is used to advise where to send email?*
126146> A: ** MX** record.
127147
128- ### 2.5 TXT Record (Text)
148+ #### 2.5 TXT Record (Text)
129149
130150* Arbitrary text data associated with the domain.
131151* Common uses:
@@ -139,7 +159,7 @@ example.com. IN TXT "v=spf1 include:_spf.google.com ~all"
139159
140160---
141161
142- ## 3. DNS Resolution Flow (Recursive Query)
162+ ### 3. DNS Resolution Flow (Recursive Query)
143163
144164High‑level pipeline:
145165
@@ -153,7 +173,7 @@ flowchart LR
153173 B --> A
154174```
155175
156- ### Step‑by‑Step
176+ #### Step‑by‑Step
157177
1581781 . ** Client check (local cache)**
159179
@@ -181,37 +201,37 @@ tryhackme.com. IN NS kip.ns.cloudflare.com.
181201tryhackme.com. IN NS uma.ns.cloudflare.com.
182202```
183203
184- 5 . ** Authoritative DNS server**
204+ 1 . ** Authoritative DNS server**
185205
186206 * Stores the real DNS zone for ` tryhackme.com ` .
187207 * Returns the requested record(s): A / AAAA / MX / TXT / etc.
188208
189- 6 . ** Back to recursive → client**
209+ 2 . ** Back to recursive → client**
190210
191211 * Recursive resolver caches the answer (respecting TTL) and sends it to the client.
192212
193- ### TTL – Time To Live
213+ #### TTL – Time To Live
194214
195215* Each DNS record has a ** TTL** (seconds).
196216* Defines ** how long a DNS record may be cached** before it must be re‑queried.
197217* Trade‑off: higher TTL = fewer lookups but slower updates; lower TTL = more traffic but faster propagation.
198218
199219> Q: * What field specifies how long a record should be cached?*
200220> A: ** TTL (Time To Live)** .
201-
221+ >
202222> Q: * What type of DNS server is usually provided by your ISP?*
203223> A: ** Recursive DNS server** .
204-
224+ >
205225> Q: * What type of server holds all records for a domain?*
206226> A: ** Authoritative DNS server** .
207227
208228---
209229
210- ## 4. Practical Queries (from the room)
230+ ### 4. Practical Queries (from the room)
211231
212232The TryHackMe web helper showed equivalent CLI commands.
213233
214- ### 4.1 Using ` dig `
234+ #### 4.1 Using ` dig `
215235
216236``` bash
217237# A record
@@ -234,15 +254,15 @@ Typical kinds of answers in the room:
234254* MX record priority → e.g. ` 30 ` .
235255* A record of ` www.website.thm ` → lab IP, e.g. ` 10.10.10.10 ` .
236256
237- ### 4.2 Mental mapping
257+ #### 4.2 Mental mapping
238258
239259* CNAME → alias; will ** not** have its own A record in same reply.
240260* MX → mail routing; lower priority number first.
241261* TXT → flexible; often multiple TXT records per domain.
242262
243263---
244264
245- ## 5. Quick Q&A Recap (Room‑style)
265+ ### 5. Quick Q&A Recap (Room‑style)
246266
247267* ** Q:** What does DNS stand for?
248268 ** A:** Domain Name System.
@@ -267,7 +287,7 @@ Typical kinds of answers in the room:
267287
268288---
269289
270- ## 6. Takeaways for Security / OSINT
290+ ### 6. Takeaways for Security / OSINT
271291
272292* Understanding DNS hierarchy & caching is critical for:
273293
0 commit comments