3 # Create an empty named.boot file and start the name server
5 require './dns-lib.pl';
6 $whatfailed = "Download failed";
8 $config{'named_boot_file'} =~ /^(\/[^\/]+)/;
9 $named_boot_directory = $1;
11 &lock_file($config{'named_boot_file'});
12 &lock_file("$named_boot_directory/db.cache");
13 $boot_temp = &transname("webmin.named.boot");
14 open(BOOT, "> $boot_temp");
15 print BOOT "directory $named_boot_directory\n";
17 # Create an empty root domain file... no need to do anything here
19 elsif ($in{real} == 1) {
20 # Try to download the root servers file from
21 # ftp://rs.internic.net/domain/named.root
22 &ftp_download("rs.internic.net", "/domain/named.root",
23 "$named_boot_directory/db.cache");
24 print BOOT "cache\t\t.\tdb.cache\n";
26 elsif ($in{real} == 2) {
27 # Use builtin db.cache
28 system("cp ./db.cache $named_boot_directory/db.cache 2>/dev/null");
29 print BOOT "cache\t\t.\tdb.cache\n";
32 system("cp $boot_temp $config{'named_boot_file'} 2>/dev/null");
34 &unlock_file($config{'named_boot_file'});
35 &unlock_file("$named_boot_directory/db.cache");
36 &system_logged("$config{'named_pathname'} >/dev/null 2>/dev/null </dev/null");