2020-02-05 08:20:27 -05:00
|
|
|
; config options
|
|
|
|
|
server:
|
|
|
|
|
module-config: "validator iterator"
|
|
|
|
|
qname-minimisation: "no"
|
|
|
|
|
minimal-responses: no
|
|
|
|
|
serve-expired: yes
|
2022-11-22 11:44:55 -05:00
|
|
|
serve-expired-client-timeout: 1
|
2020-02-05 08:20:27 -05:00
|
|
|
serve-expired-reply-ttl: 123
|
2022-05-06 06:48:53 -04:00
|
|
|
ede: yes
|
|
|
|
|
ede-serve-expired: yes
|
2020-02-05 08:20:27 -05:00
|
|
|
|
|
|
|
|
stub-zone:
|
|
|
|
|
name: "example.com"
|
|
|
|
|
stub-addr: 1.2.3.4
|
|
|
|
|
CONFIG_END
|
|
|
|
|
|
|
|
|
|
SCENARIO_BEGIN Test serve-expired with client-timeout and a SERVFAIL upstream reply
|
|
|
|
|
; Scenario overview:
|
|
|
|
|
; - query for example.com. IN A
|
|
|
|
|
; - check that we get an answer for example.com. IN A with the correct TTL
|
|
|
|
|
; - query again right after the TTL expired
|
|
|
|
|
; - answer from upstream is servfail
|
2024-09-24 10:47:04 -04:00
|
|
|
; - (expired cached answer will not be replaced, instead marked as unresolvable for NORR_TTL(5))
|
|
|
|
|
; - check that we get the expired cached answer
|
|
|
|
|
; - query again (the answer is available on the upstream server now)
|
|
|
|
|
; - check that we get the immediate expired answer back instead
|
2024-12-31 10:28:12 -05:00
|
|
|
; - query again (the answer is available on the upstream server now)
|
|
|
|
|
; - check that we *still* get the immediate expired answer back instead, recursion is blocked for NORR_TTL(5)
|
|
|
|
|
; - wait for NORR_TTL(5) to expire
|
|
|
|
|
; - query again
|
2024-09-24 10:47:04 -04:00
|
|
|
; - check that we get the freshly cached answer
|
2020-02-05 08:20:27 -05:00
|
|
|
|
|
|
|
|
; ns.example.com.
|
|
|
|
|
RANGE_BEGIN 0 20
|
|
|
|
|
ADDRESS 1.2.3.4
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH opcode qtype qname
|
|
|
|
|
ADJUST copy_id
|
|
|
|
|
REPLY QR NOERROR
|
|
|
|
|
SECTION QUESTION
|
2023-12-07 05:38:01 -05:00
|
|
|
example.com. IN NS
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION ANSWER
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN NS ns.example.com.
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION ADDITIONAL
|
2025-09-15 04:03:35 -04:00
|
|
|
ns.example.com. 200 IN A 1.2.3.4
|
2020-02-05 08:20:27 -05:00
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH opcode qtype qname
|
|
|
|
|
ADJUST copy_id
|
|
|
|
|
REPLY QR NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN A 5.6.7.8
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION AUTHORITY
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN NS ns.example.com.
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION ADDITIONAL
|
2025-09-15 04:03:35 -04:00
|
|
|
ns.example.com. 200 IN A 1.2.3.4
|
2020-02-05 08:20:27 -05:00
|
|
|
ENTRY_END
|
|
|
|
|
RANGE_END
|
|
|
|
|
|
|
|
|
|
; ns.example.com.
|
2024-09-24 10:47:04 -04:00
|
|
|
RANGE_BEGIN 30 40
|
2020-02-05 08:20:27 -05:00
|
|
|
ADDRESS 1.2.3.4
|
|
|
|
|
; response to A query
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH opcode qtype qname
|
|
|
|
|
ADJUST copy_id
|
|
|
|
|
REPLY QR AA SERVFAIL
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
RANGE_END
|
|
|
|
|
|
2024-09-24 10:47:04 -04:00
|
|
|
; ns.example.com.
|
2024-12-31 10:28:12 -05:00
|
|
|
RANGE_BEGIN 50 100
|
2024-09-24 10:47:04 -04:00
|
|
|
ADDRESS 1.2.3.4
|
|
|
|
|
; response to A query
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH opcode qtype qname
|
|
|
|
|
ADJUST copy_id
|
|
|
|
|
REPLY QR NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN A 5.6.7.8
|
2024-09-24 10:47:04 -04:00
|
|
|
SECTION AUTHORITY
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN NS ns.example.com.
|
2024-09-24 10:47:04 -04:00
|
|
|
SECTION ADDITIONAL
|
2025-09-15 04:03:35 -04:00
|
|
|
ns.example.com. 200 IN A 1.2.3.4
|
2024-09-24 10:47:04 -04:00
|
|
|
ENTRY_END
|
|
|
|
|
RANGE_END
|
|
|
|
|
|
2020-02-05 08:20:27 -05:00
|
|
|
; Query with RD flag
|
|
|
|
|
STEP 1 QUERY
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
REPLY RD
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Check that we got the correct answer (should be cached)
|
|
|
|
|
STEP 10 CHECK_ANSWER
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH all ttl
|
|
|
|
|
REPLY QR RD RA NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN A 5.6.7.8
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION AUTHORITY
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN NS ns.example.com.
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION ADDITIONAL
|
2025-09-15 04:03:35 -04:00
|
|
|
ns.example.com. 200 IN A 1.2.3.4
|
2020-02-05 08:20:27 -05:00
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Wait for the TTL to expire
|
2025-09-15 04:03:35 -04:00
|
|
|
STEP 11 TIME_PASSES ELAPSE 200
|
2020-02-05 08:20:27 -05:00
|
|
|
|
|
|
|
|
; Query again
|
|
|
|
|
STEP 30 QUERY
|
|
|
|
|
ENTRY_BEGIN
|
2022-05-06 06:48:53 -04:00
|
|
|
REPLY RD DO
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
2024-09-24 10:47:04 -04:00
|
|
|
; Check that we got a stale answer because of the upstream SERVFAIL
|
2020-02-05 08:20:27 -05:00
|
|
|
STEP 40 CHECK_ANSWER
|
|
|
|
|
ENTRY_BEGIN
|
2022-05-06 06:48:53 -04:00
|
|
|
MATCH all ttl ede=3
|
|
|
|
|
REPLY QR RD RA DO NOERROR
|
2020-02-05 08:20:27 -05:00
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
|
|
|
|
example.com. 123 IN A 5.6.7.8
|
|
|
|
|
SECTION AUTHORITY
|
|
|
|
|
example.com. 123 IN NS ns.example.com.
|
|
|
|
|
SECTION ADDITIONAL
|
|
|
|
|
ns.example.com. 123 IN A 1.2.3.4
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
2024-09-24 10:47:04 -04:00
|
|
|
; Query again
|
|
|
|
|
STEP 50 QUERY
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
REPLY RD DO
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Check that we got an immediate stale answer because of the previous failure,
|
2024-12-31 10:28:12 -05:00
|
|
|
; regardless if upstream has the answer already in this range.
|
2024-09-24 10:47:04 -04:00
|
|
|
STEP 60 CHECK_ANSWER
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH all ttl ede=3
|
|
|
|
|
REPLY QR RD RA DO NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
|
|
|
|
example.com. 123 IN A 5.6.7.8
|
|
|
|
|
SECTION AUTHORITY
|
|
|
|
|
example.com. 123 IN NS ns.example.com.
|
|
|
|
|
SECTION ADDITIONAL
|
|
|
|
|
ns.example.com. 123 IN A 1.2.3.4
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Query again
|
|
|
|
|
STEP 70 QUERY
|
|
|
|
|
ENTRY_BEGIN
|
2024-12-31 10:28:12 -05:00
|
|
|
REPLY RD DO
|
2024-09-24 10:47:04 -04:00
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
2024-12-31 10:28:12 -05:00
|
|
|
; Check that we still get the immediate stale answer because of the previous failure,
|
|
|
|
|
; regardless if upstream has the answer already in this range. NORR_TTL(5) blocks us from
|
|
|
|
|
; recursion.
|
2024-09-24 10:47:04 -04:00
|
|
|
STEP 80 CHECK_ANSWER
|
2024-12-31 10:28:12 -05:00
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH all ttl ede=3
|
|
|
|
|
REPLY QR RD RA DO NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
|
|
|
|
example.com. 123 IN A 5.6.7.8
|
|
|
|
|
SECTION AUTHORITY
|
|
|
|
|
example.com. 123 IN NS ns.example.com.
|
|
|
|
|
SECTION ADDITIONAL
|
|
|
|
|
ns.example.com. 123 IN A 1.2.3.4
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Let NORR_TTL(5) expire
|
|
|
|
|
STEP 81 TIME_PASSES ELAPSE 5
|
|
|
|
|
|
|
|
|
|
; Query again
|
|
|
|
|
STEP 90 QUERY
|
|
|
|
|
ENTRY_BEGIN
|
|
|
|
|
REPLY RD
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
ENTRY_END
|
|
|
|
|
|
|
|
|
|
; Check fresh reply
|
|
|
|
|
STEP 100 CHECK_ANSWER
|
2024-09-24 10:47:04 -04:00
|
|
|
ENTRY_BEGIN
|
|
|
|
|
MATCH all ttl
|
|
|
|
|
REPLY QR RD RA NOERROR
|
|
|
|
|
SECTION QUESTION
|
|
|
|
|
example.com. IN A
|
|
|
|
|
SECTION ANSWER
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN A 5.6.7.8
|
2024-09-24 10:47:04 -04:00
|
|
|
SECTION AUTHORITY
|
2025-09-15 04:03:35 -04:00
|
|
|
example.com. 200 IN NS ns.example.com.
|
2024-09-24 10:47:04 -04:00
|
|
|
SECTION ADDITIONAL
|
2025-09-15 04:03:35 -04:00
|
|
|
ns.example.com. 200 IN A 1.2.3.4
|
2024-09-24 10:47:04 -04:00
|
|
|
ENTRY_END
|
|
|
|
|
|
2020-02-05 08:20:27 -05:00
|
|
|
SCENARIO_END
|