Fallback to IP for root zone files

This commit is contained in:
Jamie Cameron
2008-07-14 19:40:53 +00:00
parent 47c3b419d1
commit 09d2253129
4 changed files with 17 additions and 3 deletions

View File

@@ -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.

View File

@@ -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);

View File

@@ -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";

View File

@@ -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");