mirror of
https://git.freebsd.org/ports.git
synced 2025-06-23 21:50:32 -04:00
While there: Make it more maintainable by sorting stuff in the Makefile and removing vestigial pre 10.3 things. Refresh the root zone hints. "Fix" the configuration section telling you to get some top level zones from f.root-servers.net, which does not allow axfr any more. [1] PR: 218656 [1] Reported by: Thomas Steen Rasmussen / Tykling [1] MFH: 2017Q2 Sponsored by: Absolight
73 lines
2.4 KiB
Text
73 lines
2.4 KiB
Text
--- bin/named/config.c.orig 2017-04-14 03:54:11 UTC
|
|
+++ bin/named/config.c
|
|
@@ -154,6 +154,8 @@ options {\n\
|
|
min-roots 2;\n\
|
|
lame-ttl 600;\n\
|
|
max-ncache-ttl 10800; /* 3 hours */\n\
|
|
+ override-cache-ttl 0; /* do not override */\n\
|
|
+ min-cache-ttl 0; /* no minimal, zero is allowed */\n\
|
|
max-cache-ttl 604800; /* 1 week */\n\
|
|
transfer-format many-answers;\n\
|
|
max-cache-size 0;\n\
|
|
--- bin/named/server.c.orig 2017-04-14 03:54:11 UTC
|
|
+++ bin/named/server.c
|
|
@@ -2890,6 +2890,16 @@ configure_view(dns_view_t *view, dns_vie
|
|
}
|
|
|
|
obj = NULL;
|
|
+ result = ns_config_get(maps, "override-cache-ttl", &obj);
|
|
+ INSIST(result == ISC_R_SUCCESS);
|
|
+ view->overridecachettl = cfg_obj_asuint32(obj);
|
|
+
|
|
+ obj = NULL;
|
|
+ result = ns_config_get(maps, "min-cache-ttl", &obj);
|
|
+ INSIST(result == ISC_R_SUCCESS);
|
|
+ view->mincachettl = cfg_obj_asuint32(obj);
|
|
+
|
|
+ obj = NULL;
|
|
result = ns_config_get(maps, "max-cache-ttl", &obj);
|
|
INSIST(result == ISC_R_SUCCESS);
|
|
view->maxcachettl = cfg_obj_asuint32(obj);
|
|
--- lib/dns/include/dns/view.h.orig 2017-04-14 03:54:11 UTC
|
|
+++ lib/dns/include/dns/view.h
|
|
@@ -151,6 +151,8 @@ struct dns_view {
|
|
isc_boolean_t requestnsid;
|
|
isc_boolean_t requestsit;
|
|
dns_ttl_t maxcachettl;
|
|
+ dns_ttl_t mincachettl;
|
|
+ dns_ttl_t overridecachettl;
|
|
dns_ttl_t maxncachettl;
|
|
dns_ttl_t prefetch_trigger;
|
|
dns_ttl_t prefetch_eligible;
|
|
--- lib/dns/resolver.c.orig 2017-04-14 03:54:11 UTC
|
|
+++ lib/dns/resolver.c
|
|
@@ -5378,6 +5378,18 @@ cache_name(fetchctx_t *fctx, dns_name_t
|
|
}
|
|
|
|
/*
|
|
+ * Enforce the configure cache TTL override.
|
|
+ */
|
|
+ if (res->view->overridecachettl)
|
|
+ rdataset->ttl = res->view->overridecachettl;
|
|
+
|
|
+ /*
|
|
+ * Enforce the configure minimum cache TTL.
|
|
+ */
|
|
+ if (rdataset->ttl < res->view->mincachettl)
|
|
+ rdataset->ttl = res->view->mincachettl;
|
|
+
|
|
+ /*
|
|
* Enforce the configure maximum cache TTL.
|
|
*/
|
|
if (rdataset->ttl > res->view->maxcachettl)
|
|
--- lib/isccfg/namedconf.c.orig 2017-04-14 03:54:11 UTC
|
|
+++ lib/isccfg/namedconf.c
|
|
@@ -1591,6 +1591,8 @@ view_clauses[] = {
|
|
#endif
|
|
{ "max-acache-size", &cfg_type_sizenodefault, 0 },
|
|
{ "max-cache-size", &cfg_type_sizenodefault, 0 },
|
|
+ { "override-cache-ttl", &cfg_type_uint32, 0 },
|
|
+ { "min-cache-ttl", &cfg_type_uint32, 0 },
|
|
{ "max-cache-ttl", &cfg_type_uint32, 0 },
|
|
{ "max-clients-per-query", &cfg_type_uint32, 0 },
|
|
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
|