1 ; config options 2 server: 3 target-fetch-policy: "0 0 0 0 0" 4 5 auth-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: 28 TEMPFILE_NAME root.zone 29 ## this is the inline file /tmp/xxx.example.com 30 ## the tempfiles are deleted when the testrun is over. 31 TEMPFILE_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. 34 K.ROOT-SERVERS.NET. IN A 193.0.14.129 35 com. IN NS a.gtld-servers.net. 36 a.gtld-servers.net. IN A 192.5.6.30 37 TEMPFILE_END 38 39 stub-zone: 40 name: "." 41 stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET. 42 CONFIG_END 43 44 SCENARIO_BEGIN Test authority zone with zonefile for root referrals 45 46 ; K.ROOT-SERVERS.NET. 47 RANGE_BEGIN 0 100 48 ADDRESS 193.0.14.129 49 ENTRY_BEGIN 50 MATCH opcode qtype qname 51 ADJUST copy_id 52 REPLY QR NOERROR 53 SECTION QUESTION 54 . IN NS 55 SECTION ANSWER 56 . IN NS K.ROOT-SERVERS.NET. 57 SECTION ADDITIONAL 58 K.ROOT-SERVERS.NET. IN A 193.0.14.129 59 ENTRY_END 60 61 ENTRY_BEGIN 62 MATCH opcode subdomain 63 ADJUST copy_id copy_query 64 REPLY QR NOERROR 65 SECTION QUESTION 66 com. IN NS 67 SECTION AUTHORITY 68 com. IN NS a.gtld-servers.net. 69 SECTION 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 72 ENTRY_END 73 RANGE_END 74 75 ; a.gtld-servers.net. 76 RANGE_BEGIN 0 100 77 ADDRESS 192.5.6.30 78 ENTRY_BEGIN 79 MATCH opcode qtype qname 80 ADJUST copy_id 81 REPLY QR NOERROR 82 SECTION QUESTION 83 com. IN NS 84 SECTION ANSWER 85 com. IN NS a.gtld-servers.net. 86 SECTION ADDITIONAL 87 a.gtld-servers.net. IN A 192.5.6.30 88 ENTRY_END 89 90 ENTRY_BEGIN 91 MATCH opcode subdomain 92 ADJUST copy_id copy_query 93 REPLY QR NOERROR 94 SECTION QUESTION 95 example.com. IN NS 96 SECTION AUTHORITY 97 example.com. IN NS ns.example.com. 98 SECTION ADDITIONAL 99 ns.example.com. IN A 1.2.3.44 100 ENTRY_END 101 RANGE_END 102 103 ; ns.example.net. 104 RANGE_BEGIN 0 100 105 ADDRESS 1.2.3.44 106 ENTRY_BEGIN 107 MATCH opcode qtype qname 108 ADJUST copy_id 109 REPLY QR NOERROR 110 SECTION QUESTION 111 example.net. IN NS 112 SECTION ANSWER 113 example.net. IN NS ns.example.net. 114 SECTION ADDITIONAL 115 ns.example.net. IN A 1.2.3.44 116 ENTRY_END 117 118 ENTRY_BEGIN 119 MATCH opcode qtype qname 120 ADJUST copy_id 121 REPLY QR NOERROR 122 SECTION QUESTION 123 ns.example.net. IN A 124 SECTION ANSWER 125 ns.example.net. IN A 1.2.3.44 126 SECTION AUTHORITY 127 example.net. IN NS ns.example.net. 128 ENTRY_END 129 130 ENTRY_BEGIN 131 MATCH opcode qtype qname 132 ADJUST copy_id 133 REPLY QR NOERROR 134 SECTION QUESTION 135 ns.example.net. IN AAAA 136 SECTION AUTHORITY 137 example.net. IN NS ns.example.net. 138 SECTION ADDITIONAL 139 www.example.net. IN A 1.2.3.44 140 ENTRY_END 141 142 ENTRY_BEGIN 143 MATCH opcode qtype qname 144 ADJUST copy_id 145 REPLY QR NOERROR 146 SECTION QUESTION 147 example.com. IN NS 148 SECTION ANSWER 149 example.com. IN NS ns.example.net. 150 ENTRY_END 151 152 ENTRY_BEGIN 153 MATCH opcode qtype qname 154 ADJUST copy_id 155 REPLY QR NOERROR 156 SECTION QUESTION 157 www.example.com. IN A 158 SECTION ANSWER 159 www.example.com. IN A 10.20.30.40 160 ENTRY_END 161 RANGE_END 162 163 STEP 1 QUERY 164 ENTRY_BEGIN 165 REPLY RD 166 SECTION QUESTION 167 www.example.com. IN A 168 ENTRY_END 169 170 ; recursion happens here. 171 STEP 20 CHECK_ANSWER 172 ENTRY_BEGIN 173 MATCH all 174 REPLY QR RD RA NOERROR 175 SECTION QUESTION 176 www.example.com. IN A 177 SECTION ANSWER 178 www.example.com. IN A 10.20.30.40 179 ENTRY_END 180 181 SCENARIO_END 182