-5717. [func] The "cache-file" option has been marked as
- deprecated. [GL #2903]
+5717. [func] The "cache-file" option, which was documented as
+ for testing purposes only and not to be used,
+ has been removed. [GL #2903]
5716. [placeholder]
avoid-v6-udp-ports { portrange; ... };
bindkeys-file quoted_string;
blackhole { address_match_element; ... };
- cache-file quoted_string;// deprecated
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( remote-servers | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
attach-cache string;
auth-nxdomain boolean;
auto-dnssec ( allow | maintain | off );
- cache-file quoted_string;// deprecated
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( remote-servers | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
Synopsis
~~~~~~~~
-:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-S** #max-socks] [**-t** directory] [**-U** #listeners] [**-u** user] [**-v**] [**-V**] [**-X** lock-file] [**-x** cache-file]
+:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-S** #max-socks] [**-t** directory] [**-U** #listeners] [**-u** user] [**-v**] [**-V**] [**-X** lock-file]
Description
~~~~~~~~~~~
Use of this option overrides the ``lock-file`` option in
``named.conf``. If set to ``none``, the lock file check is disabled.
-``-x cache-file``
- This option loads data from ``cache-file`` into the cache of the default view.
-
-.. warning::
-
- This option must not be used in normal operations. It is only of interest to BIND 9
- developers and may be removed or changed in a future release.
-
Signals
~~~~~~~
isc_mem_t *cmctx = NULL, *hmctx = NULL;
dns_dispatch_t *dispatch4 = NULL;
dns_dispatch_t *dispatch6 = NULL;
- bool reused_cache = false;
bool shared_cache = false;
int i = 0, j = 0, k = 0;
const char *str;
NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(3),
"reusing existing cache");
- reused_cache = true;
dns_cache_attach(pview->cache, &cache);
}
dns_view_getresstats(pview, &resstats);
}
dns_view_setcache(view, cache, shared_cache);
- /*
- * cache-file cannot be inherited if views are present, but this
- * should be caught by the configuration checking stage.
- */
- obj = NULL;
- result = named_config_get(maps, "cache-file", &obj);
- if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") != 0) {
- CHECK(dns_cache_setfilename(cache, cfg_obj_asstring(obj)));
- if (!reused_cache && !shared_cache) {
- CHECK(dns_cache_load(cache));
- }
- }
-
dns_cache_setcachesize(cache, max_cache_size);
dns_cache_setservestalettl(cache, max_stale_ttl);
dns_cache_setservestalerefresh(cache, stale_refresh_time);
working directory. In most cases, the ``key_name`` should be the
server's host name.
-``cache-file``
- This is for testing only. Do not use.
-
``dump-file``
This is the pathname of the file the server dumps the database to, when
instructed to do so with ``rndc dumpdb``. If not specified, the
..
.SH SYNOPSIS
.sp
-\fBnamed\fP [ [\fB\-4\fP] | [\fB\-6\fP] ] [\fB\-c\fP config\-file] [\fB\-d\fP debug\-level] [\fB\-D\fP string] [\fB\-E\fP engine\-name] [\fB\-f\fP] [\fB\-g\fP] [\fB\-L\fP logfile] [\fB\-M\fP option] [\fB\-m\fP flag] [\fB\-n\fP #cpus] [\fB\-p\fP port] [\fB\-s\fP] [\fB\-S\fP #max\-socks] [\fB\-t\fP directory] [\fB\-U\fP #listeners] [\fB\-u\fP user] [\fB\-v\fP] [\fB\-V\fP] [\fB\-X\fP lock\-file] [\fB\-x\fP cache\-file]
+\fBnamed\fP [ [\fB\-4\fP] | [\fB\-6\fP] ] [\fB\-c\fP config\-file] [\fB\-d\fP debug\-level] [\fB\-D\fP string] [\fB\-E\fP engine\-name] [\fB\-f\fP] [\fB\-g\fP] [\fB\-L\fP logfile] [\fB\-M\fP option] [\fB\-m\fP flag] [\fB\-n\fP #cpus] [\fB\-p\fP port] [\fB\-s\fP] [\fB\-S\fP #max\-socks] [\fB\-t\fP directory] [\fB\-U\fP #listeners] [\fB\-u\fP user] [\fB\-v\fP] [\fB\-V\fP] [\fB\-X\fP lock\-file]
.SH DESCRIPTION
.sp
\fBnamed\fP is a Domain Name System (DNS) server, part of the BIND 9
prevent duplicate \fBnamed\fP instances from running simultaneously.
Use of this option overrides the \fBlock\-file\fP option in
\fBnamed.conf\fP\&. If set to \fBnone\fP, the lock file check is disabled.
-.TP
-.B \fB\-x cache\-file\fP
-This option loads data from \fBcache\-file\fP into the cache of the default view.
-.UNINDENT
-.sp
-\fBWARNING:\fP
-.INDENT 0.0
-.INDENT 3.5
-This option must not be used in normal operations. It is only of interest to BIND 9
-developers and may be removed or changed in a future release.
-.UNINDENT
.UNINDENT
.SH SIGNALS
.sp
avoid\-v6\-udp\-ports { portrange; ... };
bindkeys\-file quoted_string;
blackhole { address_match_element; ... };
- cache\-file quoted_string;
catalog\-zones { zone string [ default\-masters [ port integer ]
[ dscp integer ] { ( remote\-servers | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
attach\-cache string;
auth\-nxdomain boolean;
auto\-dnssec ( allow | maintain | off );
- cache\-file quoted_string;
catalog\-zones { zone string [ default\-masters [ port integer ]
[ dscp integer ] { ( remote\-servers | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
avoid-v6-udp-ports { portrange; ... };
bindkeys-file quoted_string;
blackhole { address_match_element; ... };
- cache-file quoted_string;
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( masters | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
attach-cache string;
auth-nxdomain boolean; // default changed
auto-dnssec ( allow | maintain | off );
- cache-file quoted_string;
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( masters | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
avoid-v6-udp-ports { <portrange>; ... };
bindkeys-file <quoted_string>;
blackhole { <address_match_element>; ... };
- cache-file <quoted_string>; // deprecated
catalog-zones { zone <string> [ default-masters [ port <integer> ]
[ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port
<integer> ] | <ipv6_address> [ port <integer> ] ) [ key
attach-cache <string>;
auth-nxdomain <boolean>;
auto-dnssec ( allow | maintain | off );
- cache-file <quoted_string>; // deprecated
catalog-zones { zone <string> [ default-masters [ port <integer> ]
[ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port
<integer> ] | <ipv6_address> [ port <integer> ] ) [ key
avoid-v6-udp-ports { <portrange>; ... };
bindkeys-file <quoted_string>;
blackhole { <address_match_element>; ... };
- cache-file <quoted_string>; // deprecated
catalog-zones { zone <string> [ default-masters [ port <integer> ]
[ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port
<integer> ] | <ipv6_address> [ port <integer> ] ) [ key
attach-cache <string>;
auth-nxdomain <boolean>;
auto-dnssec ( allow | maintain | off );
- cache-file <quoted_string>; // deprecated
catalog-zones { zone <string> [ default-masters [ port <integer> ]
[ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port
<integer> ] | <ipv6_address> [ port <integer> ] ) [ key
avoid-v6-udp-ports { <portrange>; ... };
bindkeys-file <quoted_string>;
blackhole { <address_match_element>; ... };
- cache-file <quoted_string>; // deprecated
catalog-zones { zone <string> [ default-masters [ port <integer> ]
[ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port
<integer> ] | <ipv6_address> [ port <integer> ] ) [ key
const cfg_obj_t *options = NULL;
const cfg_obj_t *views = NULL;
const cfg_obj_t *acls = NULL;
- const cfg_obj_t *obj = NULL;
const cfg_listelt_t *velement;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
}
}
- if (views != NULL && options != NULL) {
- obj = NULL;
- tresult = cfg_map_get(options, "cache-file", &obj);
- if (tresult == ISC_R_SUCCESS) {
- cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
- "'cache-file' cannot be a global "
- "option if views are present");
- result = ISC_R_FAILURE;
- }
- }
-
cfg_map_get(config, "acl", &acls);
if (acls != NULL) {
/* Unlocked. */
unsigned int magic;
isc_mutex_t lock;
- isc_mutex_t filelock;
isc_mem_t *mctx; /* Main cache memory */
isc_mem_t *hmctx; /* Heap memory */
char *name;
dns_ttl_t serve_stale_ttl;
dns_ttl_t serve_stale_refresh;
isc_stats_t *stats;
-
- /* Locked by 'filelock'. */
- char *filename;
- /* Access to the on-disk cache file is also locked by 'filelock'. */
};
/***
}
isc_mutex_init(&cache->lock);
- isc_mutex_init(&cache->filelock);
isc_refcount_init(&cache->references, 1);
isc_refcount_init(&cache->live_tasks, 1);
result = isc_stats_create(cmctx, &cache->stats,
dns_cachestatscounter_max);
if (result != ISC_R_SUCCESS) {
- goto cleanup_filelock;
+ goto cleanup_lock;
}
cache->db_type = isc_mem_strdup(cmctx, db_type);
isc_task_detach(&dbtask);
}
- cache->filename = NULL;
-
cache->magic = CACHE_MAGIC;
/*
cache->db_argc * sizeof(char *));
}
isc_mem_free(cmctx, cache->db_type);
-cleanup_filelock:
- isc_mutex_destroy(&cache->filelock);
isc_stats_detach(&cache->stats);
+cleanup_lock:
isc_mutex_destroy(&cache->lock);
if (cache->name != NULL) {
isc_mem_free(cmctx, cache->name);
isc_mutex_destroy(&cache->cleaner.lock);
- if (cache->filename) {
- isc_mem_free(cache->mctx, cache->filename);
- cache->filename = NULL;
- }
-
if (cache->db != NULL) {
dns_db_detach(&cache->db);
}
}
isc_mutex_destroy(&cache->lock);
- isc_mutex_destroy(&cache->filelock);
cache->magic = 0;
isc_mem_detach(&cache->hmctx);
if (isc_refcount_decrement(&cache->references) == 1) {
cache->cleaner.overmem = false;
- /*
- * When the cache is shut down, dump it to a file if one is
- * specified.
- */
- isc_result_t result = dns_cache_dump(cache);
- if (result != ISC_R_SUCCESS) {
- isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
- DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
- "error dumping cache: %s ",
- isc_result_totext(result));
- }
/*
* If the cleaner task exists, let it free the cache.
UNLOCK(&cache->lock);
}
-isc_result_t
-dns_cache_setfilename(dns_cache_t *cache, const char *filename) {
- char *newname;
-
- REQUIRE(VALID_CACHE(cache));
- REQUIRE(filename != NULL);
-
- newname = isc_mem_strdup(cache->mctx, filename);
-
- LOCK(&cache->filelock);
- if (cache->filename) {
- isc_mem_free(cache->mctx, cache->filename);
- }
- cache->filename = newname;
- UNLOCK(&cache->filelock);
-
- return (ISC_R_SUCCESS);
-}
-
-isc_result_t
-dns_cache_load(dns_cache_t *cache) {
- isc_result_t result;
-
- REQUIRE(VALID_CACHE(cache));
-
- if (cache->filename == NULL) {
- return (ISC_R_SUCCESS);
- }
-
- LOCK(&cache->filelock);
- result = dns_db_load(cache->db, cache->filename, dns_masterformat_text,
- 0);
- UNLOCK(&cache->filelock);
-
- return (result);
-}
-
-isc_result_t
-dns_cache_dump(dns_cache_t *cache) {
- isc_result_t result;
-
- REQUIRE(VALID_CACHE(cache));
-
- if (cache->filename == NULL) {
- return (ISC_R_SUCCESS);
- }
-
- LOCK(&cache->filelock);
- result = dns_master_dump(cache->mctx, cache->db, NULL,
- &dns_master_style_cache, cache->filename,
- dns_masterformat_text, NULL);
- UNLOCK(&cache->filelock);
- return (result);
-}
-
const char *
dns_cache_getname(dns_cache_t *cache) {
REQUIRE(VALID_CACHE(cache));
*\li *dbp is attached to the database.
*/
-isc_result_t
-dns_cache_setfilename(dns_cache_t *cache, const char *filename);
-/*%<
- * If 'filename' is non-NULL, make the cache persistent.
- * The cache's data will be stored in the given file.
- * If 'filename' is NULL, make the cache non-persistent.
- * Files that are no longer used are not unlinked automatically.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Various file-related failures
- */
-
-isc_result_t
-dns_cache_load(dns_cache_t *cache);
-/*%<
- * If the cache has a file name, load the cache contents from the file.
- * Previous cache contents are not discarded.
- * If no file name has been set, do nothing and return success.
- *
- * MT:
- *\li Multiple simultaneous attempts to load or dump the cache
- * will be serialized with respect to one another, but
- * the cache may be read and updated while the dump is
- * in progress. Updates performed during loading
- * may or may not be preserved, and reads may return
- * either the old or the newly loaded data.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- * \li Various failures depending on the database implementation type
- */
-
-isc_result_t
-dns_cache_dump(dns_cache_t *cache);
-/*%<
- * If the cache has a file name, write the cache contents to disk,
- * overwriting any preexisting file. If no file name has been set,
- * do nothing and return success.
- *
- * MT:
- *\li Multiple simultaneous attempts to load or dump the cache
- * will be serialized with respect to one another, but
- * the cache may be read and updated while the dump is
- * in progress. Updates performed during the dump may
- * or may not be reflected in the dumped file.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- * \li Various failures depending on the database implementation type
- */
-
isc_result_t
dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now);
/*%<
{ "allow-v6-synthesis", NULL, CFG_CLAUSEFLAG_ANCIENT },
{ "attach-cache", &cfg_type_astring, 0 },
{ "auth-nxdomain", &cfg_type_boolean, 0 },
- { "cache-file", &cfg_type_qstring, CFG_CLAUSEFLAG_DEPRECATED },
+ { "cache-file", &cfg_type_qstring, CFG_CLAUSEFLAG_ANCIENT },
{ "catalog-zones", &cfg_type_catz, 0 },
{ "check-names", &cfg_type_checknames, CFG_CLAUSEFLAG_MULTI },
{ "cleaning-interval", NULL, CFG_CLAUSEFLAG_ANCIENT },