1; config options 2server: 3 target-fetch-policy: "0 0 0 0 0" 4 5auth-zone: 6 name: "." 7 ## zonefile (or none). 8 ## zonefile: "example.com.zone" 9 ## master by IP address or hostname 10 ## can list multiple masters, each on one line. 11 ## master: 12 ## url for http fetch 13 ## url: 14 ## queries from downstream clients get authoritative answers. 15 ## for-downstream: yes 16 for-downstream: no 17 ## queries are used to fetch authoritative answers from this zone, 18 ## instead of unbound itself sending queries there. 19 ## for-upstream: yes 20 for-upstream: yes 21 ## on failures with for-upstream, fallback to sending queries to 22 ## the authority servers 23 ## fallback-enabled: no 24 fallback-enabled: yes 25 26 ## this line generates zonefile: \n"/tmp/xxx.example.com"\n 27 zonefile: 28TEMPFILE_NAME root.zone 29 ## this is the inline file /tmp/xxx.example.com 30 ## the tempfiles are deleted when the testrun is over. 31TEMPFILE_CONTENTS root.zone 32. 86400 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018013100 1800 900 604800 86400 33. 518400 IN NS k.root-servers.net. 34K.ROOT-SERVERS.NET. IN A 193.0.14.129 35com. IN NS a.gtld-servers.net. 36a.gtld-servers.net. IN A 192.5.6.30 37TEMPFILE_END 38 39stub-zone: 40 name: "." 41 stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET. 42CONFIG_END 43 44SCENARIO_BEGIN Test authority zone with zonefile for root referrals 45 46; K.ROOT-SERVERS.NET. 47RANGE_BEGIN 0 100 48 ADDRESS 193.0.14.129 49ENTRY_BEGIN 50MATCH opcode qtype qname 51ADJUST copy_id 52REPLY QR NOERROR 53SECTION QUESTION 54. IN NS 55SECTION ANSWER 56. IN NS K.ROOT-SERVERS.NET. 57SECTION ADDITIONAL 58K.ROOT-SERVERS.NET. IN A 193.0.14.129 59ENTRY_END 60 61ENTRY_BEGIN 62MATCH opcode subdomain 63ADJUST copy_id copy_query 64REPLY QR NOERROR 65SECTION QUESTION 66com. IN NS 67SECTION AUTHORITY 68com. IN NS a.gtld-servers.net. 69SECTION ADDITIONAL 70; disable this referral for the test, we want to use the builtin copy of the zone 71; a.gtld-servers.net. IN A 192.5.6.30 72ENTRY_END 73RANGE_END 74 75; a.gtld-servers.net. 76RANGE_BEGIN 0 100 77 ADDRESS 192.5.6.30 78ENTRY_BEGIN 79MATCH opcode qtype qname 80ADJUST copy_id 81REPLY QR NOERROR 82SECTION QUESTION 83com. IN NS 84SECTION ANSWER 85com. IN NS a.gtld-servers.net. 86SECTION ADDITIONAL 87a.gtld-servers.net. IN A 192.5.6.30 88ENTRY_END 89 90ENTRY_BEGIN 91MATCH opcode subdomain 92ADJUST copy_id copy_query 93REPLY QR NOERROR 94SECTION QUESTION 95example.com. IN NS 96SECTION AUTHORITY 97example.com. IN NS ns.example.com. 98SECTION ADDITIONAL 99ns.example.com. IN A 1.2.3.44 100ENTRY_END 101RANGE_END 102 103; ns.example.net. 104RANGE_BEGIN 0 100 105 ADDRESS 1.2.3.44 106ENTRY_BEGIN 107MATCH opcode qtype qname 108ADJUST copy_id 109REPLY QR NOERROR 110SECTION QUESTION 111example.net. IN NS 112SECTION ANSWER 113example.net. IN NS ns.example.net. 114SECTION ADDITIONAL 115ns.example.net. IN A 1.2.3.44 116ENTRY_END 117 118ENTRY_BEGIN 119MATCH opcode qtype qname 120ADJUST copy_id 121REPLY QR NOERROR 122SECTION QUESTION 123ns.example.net. IN A 124SECTION ANSWER 125ns.example.net. IN A 1.2.3.44 126SECTION AUTHORITY 127example.net. IN NS ns.example.net. 128ENTRY_END 129 130ENTRY_BEGIN 131MATCH opcode qtype qname 132ADJUST copy_id 133REPLY QR NOERROR 134SECTION QUESTION 135ns.example.net. IN AAAA 136SECTION AUTHORITY 137example.net. IN NS ns.example.net. 138SECTION ADDITIONAL 139www.example.net. IN A 1.2.3.44 140ENTRY_END 141 142ENTRY_BEGIN 143MATCH opcode qtype qname 144ADJUST copy_id 145REPLY QR NOERROR 146SECTION QUESTION 147example.com. IN NS 148SECTION ANSWER 149example.com. IN NS ns.example.net. 150ENTRY_END 151 152ENTRY_BEGIN 153MATCH opcode qtype qname 154ADJUST copy_id 155REPLY QR NOERROR 156SECTION QUESTION 157www.example.com. IN A 158SECTION ANSWER 159www.example.com. IN A 10.20.30.40 160ENTRY_END 161RANGE_END 162 163STEP 1 QUERY 164ENTRY_BEGIN 165REPLY RD 166SECTION QUESTION 167www.example.com. IN A 168ENTRY_END 169 170; recursion happens here. 171STEP 20 CHECK_ANSWER 172ENTRY_BEGIN 173MATCH all 174REPLY QR RD RA NOERROR 175SECTION QUESTION 176www.example.com. IN A 177SECTION ANSWER 178www.example.com. IN A 10.20.30.40 179ENTRY_END 180 181SCENARIO_END 182