📄 dns_boot.cgi
字号:
#!/usr/local/bin/perl# dns_boot.cgi# Create an empty named.conf file and start the name serverrequire './bind8-lib.pl';&error_setup($text{'boot_err'});&ReadParse;$config{'named_conf'} =~ /^(\S+)\/([^\/]+)$/;$conf_directory = $1;$conf_temp = "/tmp/webmin.named.conf";open(BOOT, "> $conf_temp");print BOOT "options {\n";print BOOT "\tdirectory \"$conf_directory\";\n";print BOOT "\tpid-file \"/var/run/named.pid\";\n";print BOOT "\t};\n";print BOOT "\n";mkdir("/var/run", 0755);if ($in{real} == 0) { # Create an empty root domain file... no need to do anything here }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", "$conf_directory/db.cache"); print BOOT "zone \".\" {\n"; print BOOT "\ttype hint;\n"; print BOOT "\tfile \"$conf_directory/db.cache\";\n"; print BOOT "\t};\n"; print BOOT "\n"; }elsif ($in{real} == 2) { # Use builtin db.cache system("cp ./db.cache $conf_directory/db.cache 2>/dev/null"); print BOOT "zone \".\" {\n"; print BOOT "\ttype hint;\n"; print BOOT "\tfile \"$conf_directory/db.cache\";\n"; print BOOT "\t};\n"; print BOOT "\n"; }close(BOOT);system("cp $conf_temp $config{'named_conf'} 2>/dev/null");unlink($conf_temp);system("$config{'named_path'} -c $config{'named_conf'} >/dev/null 2>/dev/null");redirect("");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -