1 ; config options 2 server: 3 access-control: 127.0.0.1 allow_snoop 4 module-config: "validator iterator" 5 qname-minimisation: "no" 6 minimal-responses: no 7 iter-scrub-promiscuous: no 8 serve-original-ttl: yes 9 cache-max-ttl: 1000 10 cache-min-ttl: 20 11 serve-expired: yes 12 serve-expired-client-timeout: 0 13 serve-expired-reply-ttl: 123 14 ede: yes 15 ede-serve-expired: yes 16 17 stub-zone: 18 name: "example.com" 19 stub-addr: 1.2.3.4 20 CONFIG_END 21 22 SCENARIO_BEGIN Test serve-original-ttl 23 ; Scenario overview: 24 ; - query for example.com. IN A 25 ; - check that we get an answer for example.com. IN A with the correct TTL 26 ; - query again after a couple seconds and check that we get the original TTL 27 ; (next steps are combination with serve-expired) 28 ; - query again after the TTL expired 29 ; - check that we get the expired cached answer with the original TTL 30 31 ; ns.example.com. 32 RANGE_BEGIN 0 100 33 ADDRESS 1.2.3.4 34 ENTRY_BEGIN 35 MATCH opcode qtype qname 36 ADJUST copy_id 37 REPLY QR NOERROR 38 SECTION QUESTION 39 example.com. IN NS 40 SECTION ANSWER 41 example.com. IN NS ns.example.com. 42 SECTION ADDITIONAL 43 ns.example.com. IN A 1.2.3.4 44 ENTRY_END 45 46 ENTRY_BEGIN 47 MATCH opcode qtype qname 48 ADJUST copy_id 49 REPLY QR NOERROR 50 SECTION QUESTION 51 example.com. IN A 52 SECTION ANSWER 53 example.com. 10 IN A 5.6.7.8 54 SECTION AUTHORITY 55 example.com. IN NS ns.example.com. 56 SECTION ADDITIONAL 57 ns.example.com. IN A 1.2.3.4 58 ENTRY_END 59 RANGE_END 60 61 ; Query with RD flag 62 STEP 1 QUERY 63 ENTRY_BEGIN 64 REPLY RD 65 SECTION QUESTION 66 example.com. IN A 67 ENTRY_END 68 69 ; Check that we got the correct answer (should be cached) 70 STEP 10 CHECK_ANSWER 71 ENTRY_BEGIN 72 MATCH all ttl 73 REPLY QR RD RA NOERROR 74 SECTION QUESTION 75 example.com. IN A 76 SECTION ANSWER 77 example.com. 10 IN A 5.6.7.8 78 SECTION AUTHORITY 79 example.com. IN NS ns.example.com. 80 SECTION ADDITIONAL 81 ns.example.com. IN A 1.2.3.4 82 ENTRY_END 83 84 ; Wait a couple of seconds (< 10) 85 STEP 11 TIME_PASSES ELAPSE 5 86 87 ; Query again 88 STEP 20 QUERY 89 ENTRY_BEGIN 90 REPLY 91 SECTION QUESTION 92 example.com. IN A 93 ENTRY_END 94 95 ; Check that we got the cached answer with the original TTL 96 ; (Passively checks that minimum and maximum TTLs are ignored) 97 STEP 30 CHECK_ANSWER 98 ENTRY_BEGIN 99 MATCH all ttl 100 REPLY QR RA NOERROR 101 SECTION QUESTION 102 example.com. IN A 103 SECTION ANSWER 104 example.com. 10 A 5.6.7.8 105 SECTION AUTHORITY 106 example.com. 3600 NS ns.example.com. 107 SECTION ADDITIONAL 108 ns.example.com. 3600 A 1.2.3.4 109 ENTRY_END 110 111 ; Wait for the TTL to expire 112 STEP 31 TIME_PASSES ELAPSE 3601 113 114 ; Query again 115 STEP 40 QUERY 116 ENTRY_BEGIN 117 REPLY DO 118 SECTION QUESTION 119 example.com. IN A 120 ENTRY_END 121 122 ; Check that we got a stale answer with the original TTL 123 STEP 50 CHECK_ANSWER 124 ENTRY_BEGIN 125 MATCH all ttl ede=3 126 REPLY QR RA DO NOERROR 127 SECTION QUESTION 128 example.com. IN A 129 SECTION ANSWER 130 example.com. 10 A 5.6.7.8 131 SECTION AUTHORITY 132 example.com. NS ns.example.com. 133 SECTION ADDITIONAL 134 ns.example.com. A 1.2.3.4 135 ENTRY_END 136 137 ; Give time for the pending query to get answered 138 STEP 51 TRAFFIC 139 140 SCENARIO_END 141