diff --git a/bind8/CHANGELOG b/bind8/CHANGELOG index 0e3b63aed..fa589c8d8 100644 --- a/bind8/CHANGELOG +++ b/bind8/CHANGELOG @@ -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. diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index f6cbda8d1..3d72ca840 100644 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -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 = ); close(VERSION); diff --git a/bind8/dns_boot.cgi b/bind8/dns_boot.cgi index cb6be31e9..8608aeaa1 100755 --- a/bind8/dns_boot.cgi +++ b/bind8/dns_boot.cgi @@ -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"; diff --git a/bind8/refetch.cgi b/bind8/refetch.cgi index 6fffad92c..6c69be68f 100755 --- a/bind8/refetch.cgi +++ b/bind8/refetch.cgi @@ -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");