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 ede: yes 11 ede-serve-expired: yes 12 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 with client-timeout and a SERVFAIL upstream reply 20 ; Scenario overview: 21 ; - query for example.com. IN A 22 ; - answer from upstream is SERVFAIL; will be cached for NORR_TTL(5) 23 ; - check that the client gets the SERVFAIL; also cached 24 ; - query again right after the TTL expired 25 ; - cached SERVFAIL should be ignored and upstream queried 26 ; - check that we get the correct answer 27 28 ; ns.example.com. 29 RANGE_BEGIN 0 20 30 ADDRESS 1.2.3.4 31 ; response to A query 32 ENTRY_BEGIN 33 MATCH opcode qtype qname 34 ADJUST copy_id 35 REPLY QR AA SERVFAIL 36 SECTION QUESTION 37 example.com. IN A 38 ENTRY_END 39 RANGE_END 40 41 ; ns.example.com. 42 RANGE_BEGIN 40 100 43 ADDRESS 1.2.3.4 44 ENTRY_BEGIN 45 MATCH opcode qtype qname 46 ADJUST copy_id 47 REPLY QR NOERROR 48 SECTION QUESTION 49 example.com. IN NS 50 SECTION ANSWER 51 example.com. 10 IN NS ns.example.com. 52 SECTION ADDITIONAL 53 ns.example.com. 10 IN A 1.2.3.4 54 ENTRY_END 55 56 ENTRY_BEGIN 57 MATCH opcode qtype qname 58 ADJUST copy_id 59 REPLY QR NOERROR 60 SECTION QUESTION 61 example.com. IN A 62 SECTION ANSWER 63 example.com. 10 IN A 5.6.7.8 64 SECTION AUTHORITY 65 example.com. 10 IN NS ns.example.com. 66 SECTION ADDITIONAL 67 ns.example.com. 10 IN A 1.2.3.4 68 ENTRY_END 69 RANGE_END 70 71 ; Query with RD flag 72 STEP 0 QUERY 73 ENTRY_BEGIN 74 REPLY RD 75 SECTION QUESTION 76 example.com. IN A 77 ENTRY_END 78 79 ; Check that we get the SERVFAIL (will be cached) 80 STEP 10 CHECK_ANSWER 81 ENTRY_BEGIN 82 MATCH all 83 REPLY QR RD RA SERVFAIL 84 SECTION QUESTION 85 example.com. IN A 86 ENTRY_END 87 88 ; Query again 89 STEP 20 QUERY 90 ENTRY_BEGIN 91 REPLY RD 92 SECTION QUESTION 93 example.com. IN A 94 ENTRY_END 95 96 ; Check that we get the cached SERVFAIL 97 STEP 30 CHECK_ANSWER 98 ENTRY_BEGIN 99 MATCH all 100 REPLY QR RD RA SERVFAIL 101 SECTION QUESTION 102 example.com. IN A 103 ENTRY_END 104 105 ; Wait for the SERVFAIL to expire 106 STEP 31 TIME_PASSES ELAPSE 6 107 108 ; Query again 109 STEP 40 QUERY 110 ENTRY_BEGIN 111 REPLY RD 112 SECTION QUESTION 113 example.com. IN A 114 ENTRY_END 115 116 ; Check that we got the correct answer 117 STEP 50 CHECK_ANSWER 118 ENTRY_BEGIN 119 MATCH all ttl 120 REPLY QR RD RA NOERROR 121 SECTION QUESTION 122 example.com. IN A 123 SECTION ANSWER 124 example.com. 10 IN A 5.6.7.8 125 SECTION AUTHORITY 126 example.com. 10 IN NS ns.example.com. 127 SECTION ADDITIONAL 128 ns.example.com. 10 IN A 1.2.3.4 129 ENTRY_END 130 131 SCENARIO_END 132