xref: /netbsd-src/external/bsd/unbound/dist/testdata/iter_prefetch_fail.rpl (revision f42d8de7d1744f0ae38eedac13b4320e5351d1d6)
1; config options
2server:
3	target-fetch-policy: "0 0 0 0 0"
4	prefetch: "yes"
5	minimal-responses: no
6
7stub-zone:
8	name: "."
9	stub-addr: 193.0.14.129 	# K.ROOT-SERVERS.NET.
10CONFIG_END
11
12SCENARIO_BEGIN Test resolver prefetch where it fails to fetch
13
14; K.ROOT-SERVERS.NET.
15RANGE_BEGIN 0 200
16	ADDRESS 193.0.14.129
17ENTRY_BEGIN
18MATCH opcode qtype qname
19ADJUST copy_id
20REPLY QR NOERROR
21SECTION QUESTION
22. IN NS
23SECTION ANSWER
24. IN NS	K.ROOT-SERVERS.NET.
25SECTION ADDITIONAL
26K.ROOT-SERVERS.NET.	IN	A	193.0.14.129
27ENTRY_END
28
29ENTRY_BEGIN
30MATCH opcode subdomain
31ADJUST copy_id copy_query
32REPLY QR NOERROR
33SECTION QUESTION
34com. IN NS
35SECTION AUTHORITY
36com.	IN NS	a.gtld-servers.net.
37SECTION ADDITIONAL
38a.gtld-servers.net.	IN 	A	192.5.6.30
39ENTRY_END
40RANGE_END
41
42; a.gtld-servers.net.
43RANGE_BEGIN 0 200
44	ADDRESS 192.5.6.30
45ENTRY_BEGIN
46MATCH opcode qtype qname
47ADJUST copy_id
48REPLY QR NOERROR
49SECTION QUESTION
50com. IN NS
51SECTION ANSWER
52com.	IN NS	a.gtld-servers.net.
53SECTION ADDITIONAL
54a.gtld-servers.net.	IN 	A	192.5.6.30
55ENTRY_END
56
57ENTRY_BEGIN
58MATCH opcode subdomain
59ADJUST copy_id copy_query
60REPLY QR NOERROR
61SECTION QUESTION
62example.com. IN NS
63SECTION AUTHORITY
64example.com.	IN NS	ns.example.com.
65SECTION ADDITIONAL
66ns.example.com.		IN 	A	1.2.3.4
67ENTRY_END
68RANGE_END
69
70; ns.example.com.
71RANGE_BEGIN 0 40
72	ADDRESS 1.2.3.4
73ENTRY_BEGIN
74MATCH opcode qtype qname
75ADJUST copy_id
76REPLY QR NOERROR
77SECTION QUESTION
78example.com. IN NS
79SECTION ANSWER
80example.com.	IN NS	ns.example.com.
81SECTION ADDITIONAL
82ns.example.com.		IN 	A	1.2.3.4
83ENTRY_END
84
85ENTRY_BEGIN
86MATCH opcode qtype qname
87ADJUST copy_id
88REPLY QR NOERROR
89SECTION QUESTION
90ns.example.com. IN AAAA
91SECTION ANSWER
92SECTION AUTHORITY
93example.com.	IN SOA	ns.example.com. hostmaster.example.com. 1 2 3 4 5
94ENTRY_END
95
96ENTRY_BEGIN
97MATCH opcode qtype qname
98ADJUST copy_id
99REPLY QR NOERROR
100SECTION QUESTION
101ns.example.com. IN A
102SECTION ANSWER
103ns.example.com.		IN 	A	1.2.3.4
104ENTRY_END
105
106ENTRY_BEGIN
107MATCH opcode qtype qname
108ADJUST copy_id
109REPLY QR NOERROR
110SECTION QUESTION
111www.example.com. IN A
112SECTION ANSWER
113www.example.com. 3600 IN A	10.20.30.40
114SECTION AUTHORITY
115example.com.	3600 IN NS	ns.example.com.
116SECTION ADDITIONAL
117ns.example.com.	3600 	IN 	A	1.2.3.4
118ENTRY_END
119RANGE_END
120
121; ns.example.com.
122RANGE_BEGIN 50 100
123	ADDRESS 1.2.3.4
124ENTRY_BEGIN
125MATCH opcode qtype qname
126ADJUST copy_id
127REPLY QR NOERROR
128SECTION QUESTION
129example.com. IN NS
130SECTION ANSWER
131example.com.	IN NS	ns.example.com.
132SECTION ADDITIONAL
133ns.example.com.		IN 	A	1.2.3.4
134ENTRY_END
135
136ENTRY_BEGIN
137MATCH opcode qtype qname
138ADJUST copy_id
139REPLY QR NOERROR
140SECTION QUESTION
141ns.example.com. IN A
142SECTION ANSWER
143ns.example.com.		IN 	A	1.2.3.4
144ENTRY_END
145
146ENTRY_BEGIN
147MATCH opcode qtype qname
148ADJUST copy_id
149REPLY QR NOERROR
150SECTION QUESTION
151ns.example.com. IN AAAA
152SECTION ANSWER
153SECTION AUTHORITY
154example.com.	IN SOA	ns.example.com. hostmaster.example.com. 1 2 3 4 5
155ENTRY_END
156
157ENTRY_BEGIN
158MATCH opcode qtype qname
159ADJUST copy_id
160REPLY QR AA SERVFAIL
161SECTION QUESTION
162www.example.com. IN A
163;SECTION ANSWER
164;www.example.com. 3600 IN A	10.20.30.40
165;SECTION AUTHORITY
166;example.com.	3600 IN NS	ns.example.com.
167;SECTION ADDITIONAL
168;ns.example.com.	3600 	IN 	A	1.2.3.4
169ENTRY_END
170RANGE_END
171
172; note ns.example.com range for steps 100 - 160 is not entered
173; no queries should be sent there
174
175; ns.example.com.
176RANGE_BEGIN 160 200
177	ADDRESS 1.2.3.4
178ENTRY_BEGIN
179MATCH opcode qtype qname
180ADJUST copy_id
181REPLY QR NOERROR
182SECTION QUESTION
183example.com. IN NS
184SECTION ANSWER
185example.com.	IN NS	ns.example.com.
186SECTION ADDITIONAL
187ns.example.com.		IN 	A	1.2.3.4
188ENTRY_END
189
190ENTRY_BEGIN
191MATCH opcode qtype qname
192ADJUST copy_id
193REPLY QR NOERROR
194SECTION QUESTION
195ns.example.com. IN AAAA
196SECTION ANSWER
197SECTION AUTHORITY
198example.com.	IN SOA	ns.example.com. hostmaster.example.com. 1 2 3 4 5
199ENTRY_END
200
201ENTRY_BEGIN
202MATCH opcode qtype qname
203ADJUST copy_id
204REPLY QR NOERROR
205SECTION QUESTION
206ns.example.com. IN A
207SECTION ANSWER
208ns.example.com.		IN 	A	1.2.3.4
209ENTRY_END
210
211ENTRY_BEGIN
212MATCH opcode qtype qname
213ADJUST copy_id
214REPLY QR NOERROR
215SECTION QUESTION
216www.example.com. IN A
217SECTION ANSWER
218www.example.com. 3600 IN A	10.20.30.40
219SECTION AUTHORITY
220example.com.	3600 IN NS	ns.example.com.
221SECTION ADDITIONAL
222ns.example.com.	3600 	IN 	A	1.2.3.4
223ENTRY_END
224RANGE_END
225
226STEP 1 QUERY
227ENTRY_BEGIN
228REPLY RD
229SECTION QUESTION
230www.example.com. IN A
231ENTRY_END
232
233; recursion happens here.
234STEP 10 CHECK_ANSWER
235ENTRY_BEGIN
236MATCH all ttl
237REPLY QR RD RA NOERROR
238SECTION QUESTION
239www.example.com. IN A
240SECTION ANSWER
241www.example.com. 3600 IN A	10.20.30.40
242SECTION AUTHORITY
243example.com.	3600 IN NS	ns.example.com.
244SECTION ADDITIONAL
245ns.example.com.	3600 	IN 	A	1.2.3.4
246ENTRY_END
247
248; after 1800 secs still the cached answer
249STEP 20 TIME_PASSES ELAPSE 1800
250
251STEP 30 QUERY
252ENTRY_BEGIN
253REPLY RD
254SECTION QUESTION
255www.example.com. IN A
256ENTRY_END
257; recursion happens here.
258STEP 40 CHECK_ANSWER
259ENTRY_BEGIN
260MATCH all ttl
261REPLY QR RD RA NOERROR
262SECTION QUESTION
263www.example.com. IN A
264SECTION ANSWER
265www.example.com. 1800 IN A	10.20.30.40
266SECTION AUTHORITY
267example.com.	1800 IN NS	ns.example.com.
268SECTION ADDITIONAL
269ns.example.com.	1800 	IN 	A	1.2.3.4
270ENTRY_END
271
272; after 1440 we are 360 seconds before the expiry
273; (the authority changes behind the scenes to detect new lookup)
274STEP 50 TIME_PASSES ELAPSE 1440
275
276STEP 60 QUERY
277ENTRY_BEGIN
278REPLY RD
279SECTION QUESTION
280www.example.com. IN A
281ENTRY_END
282; recursion happens here.
283STEP 70 CHECK_ANSWER
284ENTRY_BEGIN
285MATCH all ttl
286REPLY QR RD RA NOERROR
287SECTION QUESTION
288www.example.com. IN A
289SECTION ANSWER
290www.example.com. 360 IN A	10.20.30.40
291SECTION AUTHORITY
292example.com.	360 IN NS	ns.example.com.
293SECTION ADDITIONAL
294ns.example.com.	360 	IN 	A	1.2.3.4
295ENTRY_END
296STEP 80 TRAFFIC
297; let traffic flow for prefetch to happen
298
299; above a cache reply with 10% of the original TTL
300; but the actual cache could have been updated, try to get that
301STEP 120 QUERY
302ENTRY_BEGIN
303REPLY RD
304SECTION QUESTION
305www.example.com. IN A
306ENTRY_END
307; recursion happens here.
308STEP 130 CHECK_ANSWER
309ENTRY_BEGIN
310MATCH all ttl
311REPLY QR RD RA NOERROR
312SECTION QUESTION
313www.example.com. IN A
314SECTION ANSWER
315www.example.com. 360 IN A	10.20.30.40
316SECTION AUTHORITY
317example.com.	360 IN NS	ns.example.com.
318SECTION ADDITIONAL
319; this is picked up from the parent (because this simulation has the
320; parent respond with servfail, not actually timeout)
321ns.example.com.	3600 	IN 	A	1.2.3.4
322ENTRY_END
323
324; another query to see if there is another lookup towards the authority
325; the server should not send too many queries towards the authority
326STEP 140 QUERY
327ENTRY_BEGIN
328REPLY RD
329SECTION QUESTION
330www.example.com. IN A
331ENTRY_END
332; recursion happens here.
333STEP 150 CHECK_ANSWER
334ENTRY_BEGIN
335MATCH all ttl
336REPLY QR RD RA NOERROR
337SECTION QUESTION
338www.example.com. IN A
339SECTION ANSWER
340www.example.com. 360 IN A	10.20.30.40
341SECTION AUTHORITY
342example.com.	360 IN NS	ns.example.com.
343SECTION ADDITIONAL
344ns.example.com.	3600 	IN 	A	1.2.3.4
345ENTRY_END
346
347; some time later another query, and now it is fine to bother the authority
348; with another lookup attempt.
349STEP 160 TIME_PASSES ELAPSE 30
350; so we are now 330 seconds before expiry.
351STEP 170 QUERY
352ENTRY_BEGIN
353REPLY RD
354SECTION QUESTION
355www.example.com. IN A
356ENTRY_END
357; recursion happens here.
358STEP 180 CHECK_ANSWER
359ENTRY_BEGIN
360MATCH all ttl
361REPLY QR RD RA NOERROR
362SECTION QUESTION
363www.example.com. IN A
364SECTION ANSWER
365www.example.com. 330 IN A	10.20.30.40
366SECTION AUTHORITY
367example.com.	330 IN NS	ns.example.com.
368SECTION ADDITIONAL
369ns.example.com.	3570 	IN 	A	1.2.3.4
370ENTRY_END
371; now the just-looked-up entry
372STEP 190 QUERY
373ENTRY_BEGIN
374REPLY RD
375SECTION QUESTION
376www.example.com. IN A
377ENTRY_END
378; recursion happens here.
379STEP 200 CHECK_ANSWER
380ENTRY_BEGIN
381MATCH all ttl
382REPLY QR RD RA NOERROR
383SECTION QUESTION
384www.example.com. IN A
385SECTION ANSWER
386www.example.com. 3600 IN A	10.20.30.40
387SECTION AUTHORITY
388example.com.	3600 IN NS	ns.example.com.
389SECTION ADDITIONAL
390ns.example.com.	3570 	IN 	A	1.2.3.4
391ENTRY_END
392
393
394SCENARIO_END
395