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