1 ; config options 2 server: 3 module-config: "validator iterator" 4 qname-minimisation: "no" 5 minimal-responses: no 6 iter-scrub-promiscuous: no 7 serve-expired: yes 8 serve-expired-client-timeout: 1 9 serve-expired-reply-ttl: 123 10 ede: yes 11 ede-serve-expired: yes 12 13 stub-zone: 14 name: "example.com" 15 stub-addr: 1.2.3.4 16 CONFIG_END 17 18 SCENARIO_BEGIN Test serve-expired with client-timeout and a SERVFAIL upstream reply 19 ; Scenario overview: 20 ; - query for example.com. IN A 21 ; - check that we get an answer for example.com. IN A with the correct TTL 22 ; - query again right after the TTL expired 23 ; - answer from upstream is servfail 24 ; - (expired cached answer will not be replaced, instead marked as unresolvable for NORR_TTL(5)) 25 ; - check that we get the expired cached answer 26 ; - query again (the answer is available on the upstream server now) 27 ; - check that we get the immediate expired answer back instead 28 ; - query again (the answer is available on the upstream server now) 29 ; - check that we *still* get the immediate expired answer back instead, recursion is blocked for NORR_TTL(5) 30 ; - wait for NORR_TTL(5) to expire 31 ; - query again 32 ; - check that we get the freshly cached answer 33 34 ; ns.example.com. 35 RANGE_BEGIN 0 20 36 ADDRESS 1.2.3.4 37 ENTRY_BEGIN 38 MATCH opcode qtype qname 39 ADJUST copy_id 40 REPLY QR NOERROR 41 SECTION QUESTION 42 example.com. IN NS 43 SECTION ANSWER 44 example.com. 200 IN NS ns.example.com. 45 SECTION ADDITIONAL 46 ns.example.com. 200 IN A 1.2.3.4 47 ENTRY_END 48 49 ENTRY_BEGIN 50 MATCH opcode qtype qname 51 ADJUST copy_id 52 REPLY QR NOERROR 53 SECTION QUESTION 54 example.com. IN A 55 SECTION ANSWER 56 example.com. 200 IN A 5.6.7.8 57 SECTION AUTHORITY 58 example.com. 200 IN NS ns.example.com. 59 SECTION ADDITIONAL 60 ns.example.com. 200 IN A 1.2.3.4 61 ENTRY_END 62 RANGE_END 63 64 ; ns.example.com. 65 RANGE_BEGIN 30 40 66 ADDRESS 1.2.3.4 67 ; response to A query 68 ENTRY_BEGIN 69 MATCH opcode qtype qname 70 ADJUST copy_id 71 REPLY QR AA SERVFAIL 72 SECTION QUESTION 73 example.com. IN A 74 ENTRY_END 75 RANGE_END 76 77 ; ns.example.com. 78 RANGE_BEGIN 50 100 79 ADDRESS 1.2.3.4 80 ; response to A query 81 ENTRY_BEGIN 82 MATCH opcode qtype qname 83 ADJUST copy_id 84 REPLY QR NOERROR 85 SECTION QUESTION 86 example.com. IN A 87 SECTION ANSWER 88 example.com. 200 IN A 5.6.7.8 89 SECTION AUTHORITY 90 example.com. 200 IN NS ns.example.com. 91 SECTION ADDITIONAL 92 ns.example.com. 200 IN A 1.2.3.4 93 ENTRY_END 94 RANGE_END 95 96 ; Query with RD flag 97 STEP 1 QUERY 98 ENTRY_BEGIN 99 REPLY RD 100 SECTION QUESTION 101 example.com. IN A 102 ENTRY_END 103 104 ; Check that we got the correct answer (should be cached) 105 STEP 10 CHECK_ANSWER 106 ENTRY_BEGIN 107 MATCH all ttl 108 REPLY QR RD RA NOERROR 109 SECTION QUESTION 110 example.com. IN A 111 SECTION ANSWER 112 example.com. 200 IN A 5.6.7.8 113 SECTION AUTHORITY 114 example.com. 200 IN NS ns.example.com. 115 SECTION ADDITIONAL 116 ns.example.com. 200 IN A 1.2.3.4 117 ENTRY_END 118 119 ; Wait for the TTL to expire 120 STEP 11 TIME_PASSES ELAPSE 200 121 122 ; Query again 123 STEP 30 QUERY 124 ENTRY_BEGIN 125 REPLY RD DO 126 SECTION QUESTION 127 example.com. IN A 128 ENTRY_END 129 130 ; Check that we got a stale answer because of the upstream SERVFAIL 131 STEP 40 CHECK_ANSWER 132 ENTRY_BEGIN 133 MATCH all ttl ede=3 134 REPLY QR RD RA DO NOERROR 135 SECTION QUESTION 136 example.com. IN A 137 SECTION ANSWER 138 example.com. 123 IN A 5.6.7.8 139 SECTION AUTHORITY 140 example.com. 123 IN NS ns.example.com. 141 SECTION ADDITIONAL 142 ns.example.com. 123 IN A 1.2.3.4 143 ENTRY_END 144 145 ; Query again 146 STEP 50 QUERY 147 ENTRY_BEGIN 148 REPLY RD DO 149 SECTION QUESTION 150 example.com. IN A 151 ENTRY_END 152 153 ; Check that we got an immediate stale answer because of the previous failure, 154 ; regardless if upstream has the answer already in this range. 155 STEP 60 CHECK_ANSWER 156 ENTRY_BEGIN 157 MATCH all ttl ede=3 158 REPLY QR RD RA DO NOERROR 159 SECTION QUESTION 160 example.com. IN A 161 SECTION ANSWER 162 example.com. 123 IN A 5.6.7.8 163 SECTION AUTHORITY 164 example.com. 123 IN NS ns.example.com. 165 SECTION ADDITIONAL 166 ns.example.com. 123 IN A 1.2.3.4 167 ENTRY_END 168 169 ; Query again 170 STEP 70 QUERY 171 ENTRY_BEGIN 172 REPLY RD DO 173 SECTION QUESTION 174 example.com. IN A 175 ENTRY_END 176 177 ; Check that we still get the immediate stale answer because of the previous failure, 178 ; regardless if upstream has the answer already in this range. NORR_TTL(5) blocks us from 179 ; recursion. 180 STEP 80 CHECK_ANSWER 181 ENTRY_BEGIN 182 MATCH all ttl ede=3 183 REPLY QR RD RA DO NOERROR 184 SECTION QUESTION 185 example.com. IN A 186 SECTION ANSWER 187 example.com. 123 IN A 5.6.7.8 188 SECTION AUTHORITY 189 example.com. 123 IN NS ns.example.com. 190 SECTION ADDITIONAL 191 ns.example.com. 123 IN A 1.2.3.4 192 ENTRY_END 193 194 ; Let NORR_TTL(5) expire 195 STEP 81 TIME_PASSES ELAPSE 5 196 197 ; Query again 198 STEP 90 QUERY 199 ENTRY_BEGIN 200 REPLY RD 201 SECTION QUESTION 202 example.com. IN A 203 ENTRY_END 204 205 ; Check fresh reply 206 STEP 100 CHECK_ANSWER 207 ENTRY_BEGIN 208 MATCH all ttl 209 REPLY QR RD RA NOERROR 210 SECTION QUESTION 211 example.com. IN A 212 SECTION ANSWER 213 example.com. 200 IN A 5.6.7.8 214 SECTION AUTHORITY 215 example.com. 200 IN NS ns.example.com. 216 SECTION ADDITIONAL 217 ns.example.com. 200 IN A 1.2.3.4 218 ENTRY_END 219 220 SCENARIO_END 221