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