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