Add --max-cache-ttl option.
diff --git a/src/cache.c b/src/cache.c
index ee4e763..ddbc5c0 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -371,6 +371,9 @@
   int freed_all = flags & F_REVERSE;
   int free_avail = 0;
 
+  if(daemon->max_cache_ttl < ttl)
+    ttl = daemon->max_cache_ttl;
+
   /* Don't log keys */
   if (flags & (F_IPV4 | F_IPV6))
     log_query(flags | F_UPSTREAM, name, addr, NULL);