mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Fallback to IP for root zone files
This commit is contained in:
@@ -77,3 +77,4 @@ The default TTL for multiple zones can now be changed on the Update Records in Z
|
||||
When adding a cluster slave server, multiple views can be entered to have slave zones created in all of them.
|
||||
Record names or values entered like ns.foo.com in the domain foo.com automatically have a . added to make them absolute as the user presumably expected, rather than being coverted to ns.foo.com.foo.com.
|
||||
Update serial number (by default) when editing records manually.
|
||||
Try downloading root zone files from the IP for rs.internic.net if the hostname cannot be resolved, to avoid catch-22 problem.
|
||||
|
||||
@@ -12,6 +12,11 @@ do '../ui-lib.pl';
|
||||
$zone_names_cache = "$module_config_directory/zone-names";
|
||||
$zone_names_version = 2;
|
||||
|
||||
# Where to find root zones file
|
||||
$internic_ftp_host = "rs.internic.net";
|
||||
$internic_ftp_ip = "198.41.0.6";
|
||||
$internic_ftp_file = "/domain/named.root";
|
||||
|
||||
if (open(VERSION, "$module_config_directory/version")) {
|
||||
chop($bind_version = <VERSION>);
|
||||
close(VERSION);
|
||||
|
||||
@@ -48,8 +48,12 @@ if ($in{real} == 0) {
|
||||
elsif ($in{real} == 1) {
|
||||
# Try to download the root servers file from
|
||||
# ftp://rs.internic.net/domain/named.root
|
||||
&ftp_download("rs.internic.net", "/domain/named.root",
|
||||
&make_chroot("$conf_directory/db.cache"));
|
||||
$hfile = &make_chroot("$conf_directory/db.cache");
|
||||
&ftp_download($internic_ftp_host, $internic_ftp_file, $hfile, \$ftperr);
|
||||
if ($ftperr) {
|
||||
# Try IP address directly
|
||||
&ftp_download($internic_ftp_ip, $internic_ftp_file, $hfile);
|
||||
}
|
||||
print BOOT "zone \".\" {\n";
|
||||
print BOOT "\ttype hint;\n";
|
||||
print BOOT "\tfile \"$conf_directory/db.cache\";\n";
|
||||
|
||||
@@ -15,7 +15,11 @@ $file = &make_chroot(&absolute_path($file));
|
||||
# Try to download the root servers file from
|
||||
# ftp://rs.internic.net/domain/named.root
|
||||
&lock_file($file);
|
||||
&ftp_download("rs.internic.net", "/domain/named.root", $file);
|
||||
&ftp_download($internic_ftp_host, $internic_ftp_file, $file, \$ftperr);
|
||||
if ($ftperr) {
|
||||
# Try IP address directly
|
||||
&ftp_download($internic_ftp_ip, $internic_ftp_file, $file);
|
||||
}
|
||||
&unlock_file($file);
|
||||
|
||||
&webmin_log("refetch");
|
||||
|
||||
Reference in New Issue
Block a user