mirror remote FTP permissions by default. There should be a new
option add an option that enables this back on.
-* Implement a `--disable-dns-cache' option that disables DNS caching.
- It is trivial to implement; simply avoid calling cache_host_lookup
- at the end of lookup_host.
-
* Honor `Content-Disposition: XXX; filename="FILE"' when creating the
file name.
+2003-09-10 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * wget.texi (Download Options): Documented new option --dns-cache.
+
2002-04-24 Hrvoje Niksic <hniksic@arsdigita.com>
* wget.texi (Robot Exclusion): Explain how to turn off the robot
@c This should really be generated automatically, possibly by including
@c an auto-generated file.
-@set VERSION 1.8.1+cvs
-@set UPDATED December 2001
+@set VERSION 1.9-cvs
+@set UPDATED September 2003
@dircategory Net Utilities
@dircategory World Wide Web
aborted when the quota is exceeded.
Setting quota to 0 or to @samp{inf} unlimits the download quota.
+
+@cindex DNS cache
+@cindex caching of DNS lookups
+@itemx --dns-cache=off
+Turn off caching of DNS lookups. Normally, Wget remembers the addresses
+it looked up from DNS so it doesn't have to repeatedly contact the DNS
+server for the same (typically small) set of addresses it retrieves
+from. This cache exists in memory only; a new Wget run will contact DNS
+again.
+
+However, in some cases it is not desirable to cache host names, even for
+the duration of a short-running application like Wget. For example,
+some HTTP servers are hosted on machines with dynamically allocated IP
+addresses that change from time to time. Their DNS entries are updated
+along with each change. When Wget's download from such a host gets
+interrupted by IP address change, Wget retries the download, but (due to
+DNS caching) it contacts the old address. With the DNS cache turned
+off, Wget will repeat the DNS lookup for every connect and will thus get
+the correct dynamic address every time---at the cost of additional DNS
+lookups where they're probably not needed.
+
+If you don't understand the above description, you probably won't need
+this option.
@end table
@node Directory Options, HTTP Options, Download Options, Invoking
Turning dirstruct on or off---the same as @samp{-x} or @samp{-nd},
respectively.
+@item dns_cache = on/off
+Turn DNS caching on/off. Since DNS caching is on by default, this
+option is normally used to turn it off. Same as @samp{--dns-cache}.
+
@item domains = @var{string}
Same as @samp{-D} (@pxref{Spanning Hosts}).
+2003-09-10 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * init.c: New command dns_cache.
+
+ * main.c (main): New option --dns-cache[=off].
+
2003-09-09 Hrvoje Niksic <hniksic@xemacs.org>
* config.h.in: Initialize HAVE_GETADDRINFO and ENABLE_IPV6.
logprintf (LOG_VERBOSE, _("done.\n"));
/* Cache the lookup information. */
- cache_host_lookup (host, al);
+ if (opt.dns_cache)
+ cache_host_lookup (host, al);
return al;
}
{ "deleteafter", &opt.delete_after, cmd_boolean },
{ "dirprefix", &opt.dir_prefix, cmd_directory },
{ "dirstruct", NULL, cmd_spec_dirstruct },
+ { "dnscache", &opt.dns_cache, cmd_boolean },
{ "domains", &opt.domains, cmd_vector },
{ "dotbytes", &opt.dot_bytes, cmd_bytes },
{ "dotsinline", &opt.dots_in_line, cmd_number },
opt.dot_bytes = 1024;
opt.dot_spacing = 10;
opt.dots_in_line = 50;
+
+ opt.dns_cache = 1;
}
\f
/* Return the user's home directory (strdup-ed), or NULL if none is
-Q, --quota=NUMBER set retrieval quota to NUMBER.\n\
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host.\n\
--limit-rate=RATE limit download rate to RATE.\n\
+ --dns-cache=off disable caching DNS lookups.\n\
\n"), stdout);
fputs (_("\
Directories:\n\
{ "cookies", required_argument, NULL, 160 },
{ "cut-dirs", required_argument, NULL, 145 },
{ "directory-prefix", required_argument, NULL, 'P' },
+ { "dns-cache", required_argument, NULL, 175 },
{ "domains", required_argument, NULL, 'D' },
{ "dot-style", required_argument, NULL, 134 },
{ "execute", required_argument, NULL, 'e' },
case 168:
setval ("postfile", optarg);
break;
+ case 175:
+ setval ("dnscache", optarg);
+ break;
case 'A':
setval ("accept", optarg);
break;
char **domains; /* See host.c */
char **exclude_domains;
+ int dns_cache; /* whether we cache DNS lookups. */
char **follow_tags; /* List of HTML tags to recursively follow. */
char **ignore_tags; /* List of HTML tags to ignore if recursing. */