xref: /netbsd-src/external/bsd/unbound/dist/testdata/fwd_cached.rpl (revision 796c32c94f6e154afc9de0f63da35c91bb739b45)
1; This is a comment.
2; config options go here.
3forward-zone: name: "." forward-addr: 216.0.0.1
4CONFIG_END
5
6SCENARIO_BEGIN Query receives answer from the cache
7
8STEP 1 QUERY
9ENTRY_BEGIN
10	REPLY RD
11	SECTION QUESTION
12	www.example.com. IN A
13ENTRY_END
14; the query is sent to the forwarder - no cache yet.
15STEP 2 CHECK_OUT_QUERY
16ENTRY_BEGIN
17	MATCH qname qtype opcode
18	SECTION QUESTION
19	www.example.com. IN A
20ENTRY_END
21STEP 3 REPLY
22ENTRY_BEGIN
23	MATCH opcode qtype qname
24	ADJUST copy_id
25	; authoritative answer
26	REPLY QR AA RD RA NOERROR
27	SECTION QUESTION
28	www.example.com. IN A
29	SECTION ANSWER
30	www.example.com. IN A 10.20.30.40
31	SECTION AUTHORITY
32	www.example.com. IN NS ns.example.com.
33	SECTION ADDITIONAL
34	ns.example.com. IN A 10.20.30.50
35ENTRY_END
36STEP 4 CHECK_ANSWER
37ENTRY_BEGIN
38	MATCH all
39	REPLY QR RD RA
40	SECTION QUESTION
41	www.example.com. IN A
42	SECTION ANSWER
43	www.example.com. IN A 10.20.30.40
44	SECTION AUTHORITY
45	www.example.com. IN NS ns.example.com.
46	SECTION ADDITIONAL
47	ns.example.com. IN A 10.20.30.50
48ENTRY_END
49
50; another query, same, so it must be answered from the cache
51STEP 5 QUERY
52ENTRY_BEGIN
53	REPLY RD
54	SECTION QUESTION
55	www.example.com. IN A
56ENTRY_END
57; immediate answer without an OUT_QUERY happening (checked on exit)
58; also, the answer does not have AA set
59STEP 6 CHECK_ANSWER
60ENTRY_BEGIN
61	MATCH all
62	REPLY QR RD RA
63	SECTION QUESTION
64	www.example.com. IN A
65	SECTION ANSWER
66	www.example.com. IN A 10.20.30.40
67	SECTION AUTHORITY
68	www.example.com. IN NS ns.example.com.
69	SECTION ADDITIONAL
70	ns.example.com. IN A 10.20.30.50
71ENTRY_END
72
73SCENARIO_END
74