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-ttl: 10 9 serve-expired-client-timeout: 1 10 11 stub-zone: 12 name: "example.com" 13 stub-addr: 1.2.3.4 14 CONFIG_END 15 16 SCENARIO_BEGIN Test serve-expired 17 ; Scenario overview: 18 ; - query for example.com. IN A 19 ; - check that we get an answer for example.com. IN A with the correct TTL 20 ; - query again right after the TTL expired + serve-expired-ttl 21 ; - check that we get an updated answer and not the cached one 22 23 ; ns.example.com. 24 RANGE_BEGIN 0 100 25 ADDRESS 1.2.3.4 26 ENTRY_BEGIN 27 MATCH opcode qtype qname 28 ADJUST copy_id 29 REPLY QR NOERROR 30 SECTION QUESTION 31 example.com. IN NS 32 SECTION ANSWER 33 example.com. IN NS ns.example.com. 34 SECTION ADDITIONAL 35 ns.example.com. IN A 1.2.3.4 36 ENTRY_END 37 RANGE_END 38 39 ; ns.example.com. 40 RANGE_BEGIN 0 20 41 ADDRESS 1.2.3.4 42 ; response to A query 43 ENTRY_BEGIN 44 MATCH opcode qtype qname 45 ADJUST copy_id 46 REPLY QR NOERROR 47 SECTION QUESTION 48 example.com. IN A 49 SECTION ANSWER 50 example.com. IN A 5.6.7.8 51 SECTION AUTHORITY 52 example.com. IN NS ns.example.com. 53 SECTION ADDITIONAL 54 ns.example.com. IN A 1.2.3.4 55 ENTRY_END 56 RANGE_END 57 58 ; Query with RD flag 59 STEP 1 QUERY 60 ENTRY_BEGIN 61 REPLY RD 62 SECTION QUESTION 63 example.com. IN A 64 ENTRY_END 65 66 ; Check that we got the correct answer (should be cached) 67 STEP 10 CHECK_ANSWER 68 ENTRY_BEGIN 69 MATCH all ttl 70 REPLY QR RD RA NOERROR 71 SECTION QUESTION 72 example.com. IN A 73 SECTION ANSWER 74 example.com. IN A 5.6.7.8 75 SECTION AUTHORITY 76 example.com. IN NS ns.example.com. 77 SECTION ADDITIONAL 78 ns.example.com. IN A 1.2.3.4 79 ENTRY_END 80 81 ; Wait for the TTL to expire + serve-expired-ttl 82 STEP 11 TIME_PASSES ELAPSE 3610 83 84 ; Query again 85 STEP 30 QUERY 86 ENTRY_BEGIN 87 REPLY RD 88 SECTION QUESTION 89 example.com. IN A 90 ENTRY_END 91 92 ; Allow the client timer to expire 93 STEP 31 TIME_PASSES ELAPSE 1 94 95 ; We shouldn't get a reply here. 96 ; There is cached data but serve-expired-ttl has passed. 97 98 STEP 40 REPLY 99 ENTRY_BEGIN 100 MATCH opcode qtype qname 101 ADJUST copy_id 102 ; authoritative answer 103 REPLY QR AA RD RA NOERROR 104 SECTION QUESTION 105 example.com. IN A 106 SECTION ANSWER 107 example.com. 3600 IN A 5.6.7.8 108 SECTION AUTHORITY 109 example.com. 3600 IN NS ns.example.com. 110 SECTION ADDITIONAL 111 ns.example.com. 3600 IN A 1.2.3.4 112 ENTRY_END 113 114 ; Check that we got the updated answer 115 STEP 41 CHECK_ANSWER 116 ENTRY_BEGIN 117 MATCH all ttl 118 REPLY QR RD RA NOERROR 119 SECTION QUESTION 120 example.com. IN A 121 SECTION ANSWER 122 example.com. IN A 5.6.7.8 123 SECTION AUTHORITY 124 example.com. IN NS ns.example.com. 125 SECTION ADDITIONAL 126 ns.example.com. IN A 1.2.3.4 127 ENTRY_END 128 129 SCENARIO_END 130