xref: /netbsd-src/external/bsd/unbound/dist/testdata/auth_xfr_host.rpl (revision e6c7e151de239c49d2e38720a061ed9d1fa99309)
1; config options
2server:
3	target-fetch-policy: "0 0 0 0 0"
4	qname-minimisation: "no"
5
6auth-zone:
7	name: "example.com."
8	## zonefile (or none).
9	## zonefile: "example.com.zone"
10	## master by IP address or hostname
11	## can list multiple masters, each on one line.
12	## master:
13	master: ns.example.net.
14	#master: 1.2.3.44
15	## url for http fetch
16	## url:
17	## queries from downstream clients get authoritative answers.
18	## for-downstream: yes
19	for-downstream: yes
20	## queries are used to fetch authoritative answers from this zone,
21	## instead of unbound itself sending queries there.
22	## for-upstream: yes
23	for-upstream: yes
24	## on failures with for-upstream, fallback to sending queries to
25	## the authority servers
26	## fallback-enabled: no
27
28	## this line generates zonefile: \n"/tmp/xxx.example.com"\n
29	zonefile:
30TEMPFILE_NAME example.com
31	## this is the inline file /tmp/xxx.example.com
32	## the tempfiles are deleted when the testrun is over.
33TEMPFILE_CONTENTS example.com
34TEMPFILE_END
35
36stub-zone:
37	name: "."
38	stub-addr: 193.0.14.129 	# K.ROOT-SERVERS.NET.
39CONFIG_END
40
41SCENARIO_BEGIN Test authority zone that needs host name lookup
42
43; K.ROOT-SERVERS.NET.
44RANGE_BEGIN 0 100
45	ADDRESS 193.0.14.129
46ENTRY_BEGIN
47MATCH opcode qtype qname
48ADJUST copy_id
49REPLY QR NOERROR
50SECTION QUESTION
51. IN NS
52SECTION ANSWER
53. IN NS	K.ROOT-SERVERS.NET.
54SECTION ADDITIONAL
55K.ROOT-SERVERS.NET.	IN	A	193.0.14.129
56ENTRY_END
57
58ENTRY_BEGIN
59MATCH opcode subdomain
60ADJUST copy_id copy_query
61REPLY QR NOERROR
62SECTION QUESTION
63com. IN NS
64SECTION AUTHORITY
65com.	IN NS	a.gtld-servers.net.
66SECTION ADDITIONAL
67a.gtld-servers.net.	IN 	A	192.5.6.30
68ENTRY_END
69
70ENTRY_BEGIN
71MATCH opcode qtype qname
72ADJUST copy_id
73REPLY QR AA NOERROR
74SECTION QUESTION
75ns.example.net. IN A
76SECTION ANSWER
77ns.example.net. IN A	1.2.3.44
78ENTRY_END
79
80ENTRY_BEGIN
81MATCH opcode qtype qname
82ADJUST copy_id
83REPLY QR AA NOERROR
84SECTION QUESTION
85ns.example.net. IN AAAA
86SECTION ANSWER
87ENTRY_END
88RANGE_END
89
90; a.gtld-servers.net.
91RANGE_BEGIN 0 100
92	ADDRESS 192.5.6.30
93ENTRY_BEGIN
94MATCH opcode qtype qname
95ADJUST copy_id
96REPLY QR NOERROR
97SECTION QUESTION
98com. IN NS
99SECTION ANSWER
100com.	IN NS	a.gtld-servers.net.
101SECTION ADDITIONAL
102a.gtld-servers.net.	IN 	A	192.5.6.30
103ENTRY_END
104
105ENTRY_BEGIN
106MATCH opcode subdomain
107ADJUST copy_id copy_query
108REPLY QR NOERROR
109SECTION QUESTION
110example.com. IN NS
111SECTION AUTHORITY
112example.com.	IN NS	ns.example.com.
113SECTION ADDITIONAL
114ns.example.com. IN A 1.2.3.44
115ENTRY_END
116RANGE_END
117
118; ns.example.com.
119RANGE_BEGIN 0 100
120	ADDRESS 1.2.3.44
121ENTRY_BEGIN
122MATCH opcode qtype qname
123ADJUST copy_id
124REPLY QR NOERROR
125SECTION QUESTION
126example.com. IN NS
127SECTION ANSWER
128example.com.	IN NS	ns.example.com.
129SECTION ADDITIONAL
130ns.example.com.		IN 	A	1.2.3.44
131ENTRY_END
132
133ENTRY_BEGIN
134MATCH opcode qtype qname
135ADJUST copy_id
136REPLY QR NOERROR
137SECTION QUESTION
138ns.example.com. IN A
139SECTION ANSWER
140ns.example.com. IN A	1.2.3.44
141SECTION AUTHORITY
142example.com.	IN NS	ns.example.com.
143ENTRY_END
144
145ENTRY_BEGIN
146MATCH opcode qtype qname
147ADJUST copy_id
148REPLY QR NOERROR
149SECTION QUESTION
150ns.example.com. IN AAAA
151SECTION AUTHORITY
152example.com.	IN NS	ns.example.com.
153SECTION ADDITIONAL
154www.example.com. IN A	1.2.3.44
155ENTRY_END
156
157ENTRY_BEGIN
158MATCH opcode qtype qname
159ADJUST copy_id
160REPLY QR NOERROR
161SECTION QUESTION
162example.com. IN NS
163SECTION ANSWER
164example.com.	IN NS	ns.example.com.
165ENTRY_END
166
167ENTRY_BEGIN
168MATCH opcode qtype qname
169ADJUST copy_id
170REPLY QR NOERROR
171SECTION QUESTION
172www.example.com. IN A
173SECTION ANSWER
174www.example.com. IN A	10.20.30.40
175ENTRY_END
176
177ENTRY_BEGIN
178MATCH opcode qtype qname
179ADJUST copy_id
180REPLY QR NOERROR
181SECTION QUESTION
182example.com. IN SOA
183SECTION ANSWER
184; serial, refresh, retry, expire, minimum
185example.com. IN SOA ns.example.com. hostmaster.example.com. 1 3600 900 86400 3600
186ENTRY_END
187
188ENTRY_BEGIN
189MATCH opcode qtype qname
190ADJUST copy_id
191REPLY QR AA NOERROR
192SECTION QUESTION
193example.com. IN AXFR
194SECTION ANSWER
195example.com. IN SOA ns.example.com. hostmaster.example.com. 1 3600 900 86400 3600
196example.com.	IN NS	ns.example.com.
197www.example.com. IN A	1.2.3.4
198example.com. IN SOA ns.example.com. hostmaster.example.com. 1 3600 900 86400 3600
199ENTRY_END
200RANGE_END
201
202STEP 1 QUERY
203ENTRY_BEGIN
204REPLY RD
205SECTION QUESTION
206www.example.com. IN A
207ENTRY_END
208
209; recursion happens here.
210STEP 20 CHECK_ANSWER
211ENTRY_BEGIN
212MATCH all
213REPLY QR AA RD RA SERVFAIL
214SECTION QUESTION
215www.example.com. IN A
216SECTION ANSWER
217ENTRY_END
218
219STEP 30 TIME_PASSES ELAPSE 10
220STEP 40 TRAFFIC
221
222STEP 50 QUERY
223ENTRY_BEGIN
224REPLY RD
225SECTION QUESTION
226www.example.com. IN A
227ENTRY_END
228
229; recursion happens here.
230STEP 60 CHECK_ANSWER
231ENTRY_BEGIN
232MATCH all
233REPLY QR AA RD RA NOERROR
234SECTION QUESTION
235www.example.com. IN A
236SECTION ANSWER
237www.example.com. IN A	1.2.3.4
238ENTRY_END
239
240; the zonefile was updated with new contents
241STEP 70 CHECK_TEMPFILE example.com
242FILE_BEGIN
243example.com.	3600	IN	SOA	ns.example.com. hostmaster.example.com. 1 3600 900 86400 3600
244example.com.	3600	IN	NS	ns.example.com.
245www.example.com.	3600	IN	A	1.2.3.4
246FILE_END
247
248SCENARIO_END
249