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