diff -ur deadwood-3.4.03/doc/Deadwood.ej deadwood-3.4.04/doc/Deadwood.ej
--- deadwood-3.4.03/doc/Deadwood.ej	2019-02-22 22:26:12.000000000 -0800
+++ deadwood-3.4.04/doc/Deadwood.ej	2022-10-09 06:43:03.136720154 -0700
@@ -361,6 +361,10 @@
 <h2>max_tcp_procs</h2>
 This is the number of allowed open TCP connections.  Default value: 8
 
+<h2>min_ttl</h2>
+The minimum amount of time we will keep an entry in the cache, in seconds
+(also called "Minimum TTL").
+
 <h2>num_retries</h2>  
 The number of times we retry to send a query upstream
 before giving up.  If this is 0, we only try once; if this is 1, 
diff -ur deadwood-3.4.03/doc/dwood3rc-all deadwood-3.4.04/doc/dwood3rc-all
--- deadwood-3.4.03/doc/dwood3rc-all	2019-02-22 22:26:12.000000000 -0800
+++ deadwood-3.4.04/doc/dwood3rc-all	2022-10-09 06:43:03.140720133 -0700
@@ -65,6 +65,9 @@
 # Maximum time an entry will stay in the cache, in seconds (86400 = one day)
 max_ttl = 86400
 
+# Minimum time an entry will stay in the cache in seconds
+min_ttl = 180
+
 # The number of times we retry to send a query upstream before giving up.
 num_retries = 2
 
diff -ur deadwood-3.4.03/src/DwMararc.h deadwood-3.4.04/src/DwMararc.h
--- deadwood-3.4.03/src/DwMararc.h	2022-08-03 00:47:08.000000000 -0700
+++ deadwood-3.4.04/src/DwMararc.h	2022-10-09 06:43:16.308650287 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019 Sam Trenholme
+/* Copyright (c) 2007-2022 Sam Trenholme
  *
  * TERMS
  *
@@ -70,13 +70,14 @@
 #define DWM_N_reject_ptr 27
 #define DWM_N_min_ttl_incomplete_cname 28
 #define DWM_N_max_ttl 29
+#define DWM_N_min_ttl 30
 
 /* Number of string parameters in the mararc file */
 #define KEY_S_COUNT 7
 /* Number of dictionary parameters in the mararc file */
 #define KEY_D_COUNT 4
 /* Number of numeric parameters in the mararc file */
-#define KEY_N_COUNT 30
+#define KEY_N_COUNT 31
 
 #ifndef MINGW
 /* Location of files we read when we run execfile("foo") */
@@ -153,6 +154,7 @@
         "min_ttl_incomplete_cname", /* How long to store incomplete CNAME
                                      * records in the cache, in seconds */
         "max_ttl", /* Maximum allowed TTL */
+        "min_ttl", /* Minimum allowed TTL */
         0 };
 
 #endif /* MARARC_C */
diff -ur deadwood-3.4.03/src/DwRecurse.c deadwood-3.4.04/src/DwRecurse.c
--- deadwood-3.4.03/src/DwRecurse.c	2022-08-03 00:47:08.000000000 -0700
+++ deadwood-3.4.04/src/DwRecurse.c	2022-10-09 06:43:27.464591019 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2015 Sam Trenholme
+/* Copyright (c) 2009-2022 Sam Trenholme
  *
  * TERMS
  *
@@ -50,7 +50,8 @@
 extern u_long dont_block;
 #endif /* MINGW */
 /* Numeric mararc parameters */
-extern int32_t max_ttl;
+extern int_fast32_t max_ttl;
+extern int_fast32_t min_ttl;
 /* Maximum number of remote connections */
 extern int_fast32_t maxprocs;
 
@@ -1750,6 +1751,9 @@
                         this_max_ttl = 30;
                 }
         }
+        if(ttl < min_ttl) {
+               ttl = min_ttl;
+        }
         if(ttl > this_max_ttl) {
                ttl = this_max_ttl;
         }
@@ -2119,9 +2123,12 @@
                 dw_log_dwstr("Invalid TTL in answer ",answer,100);
                 ttl = 3600;
         }
-        if(ttl < 60) {
-                ttl = 60;
+        if(ttl < 30) {
+                ttl = 30;
         }
+        if(ttl < min_ttl) {
+                ttl = min_ttl;
+        } 
         if(ttl > max_ttl) {
                 ttl = max_ttl;
         }
@@ -2201,6 +2208,9 @@
         if(ttl < 30) {
                 ttl = 30;
         }
+        if(ttl < min_ttl) {
+                ttl = min_ttl;
+        }
         if(ttl > max_ttl) {
                 ttl = max_ttl;
         }
diff -ur deadwood-3.4.03/src/DwSocket.c deadwood-3.4.04/src/DwSocket.c
--- deadwood-3.4.03/src/DwSocket.c	2022-08-03 00:47:07.000000000 -0700
+++ deadwood-3.4.04/src/DwSocket.c	2022-10-09 06:43:51.196464665 -0700
@@ -1,5 +1,5 @@
-/* Copyright (c) 2007-2019 Sam Trenholme
- * IPv6 code by Jean-Jacques Sarton
+/* Copyright (c) 2007-2022 Sam Trenholme
+ * IPv6 code by Jean-Jacques Sarton and Sam Trenholme
  *
  * TERMS
  *
@@ -72,6 +72,7 @@
 int_fast32_t maradns_uid = 99;
 int_fast32_t maradns_gid = 99;
 int_fast32_t max_ttl = 86400;
+int_fast32_t min_ttl = 30;
 int num_retries = 5;
 dwd_dict *blacklist_dict = 0;
 
@@ -505,6 +506,10 @@
                 300 /* 5 minutes */,
                 7776000 /* 90 days */,
                 86400 /* One day */);
+        min_ttl = get_key_n(DWM_N_min_ttl,
+                5 /* 5 seconds */,
+                86400 /* One day */,
+                60 /* One minute */);
 
         if((num_ports & (num_ports - 1)) != 0) {
                 dw_fatal("num_ports must be a power of 2");
diff -ur deadwood-3.4.03/src/DwUdpSocket.c deadwood-3.4.04/src/DwUdpSocket.c
--- deadwood-3.4.03/src/DwUdpSocket.c	2022-08-03 00:47:08.000000000 -0700
+++ deadwood-3.4.04/src/DwUdpSocket.c	2022-10-10 14:33:38.766496291 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016 Sam Trenholme and others
+/* Copyright (c) 2007-2022 Sam Trenholme and others
  *
  * TERMS
  *
@@ -56,7 +56,8 @@
 extern int min_bind;
 extern int num_ports;
 extern int num_retries;
-extern int32_t max_ttl;
+extern int_fast32_t max_ttl;
+extern int_fast32_t min_ttl;
 
 /* Other mararc parameters */
 extern dwd_dict *blacklist_dict;
@@ -872,6 +873,9 @@
                 if(ttl > max_ttl) {
                         ttl = max_ttl;
                 }
+                if(ttl < min_ttl) {
+                        ttl = min_ttl;
+                }
 
                 /* Routines in DwRecurse.c process the packet and let us know
                  * what kind of packet we got upstream (so we know how to
