China FreeBSD

社区WEB DNS 内测

  • 贡献者:iceage
  • 阅读:9298
  • 类别:系统服务
  • 更新时间:2018-09-05 16:39:03

ChinaFreeBSD WEB_DNS 


    此程序为方便管理员管理内网 DNS 而设计的bind dlz_mysql web 界面管理客户端。此版本为2017年的再续版本。自2017年始,社区计划独立发布一版 ddns 系统,17年8月完成界面,并使用C 开发了客户端同步程序。后因为考虑到法律问题自宫,并未发布。2018年6月由冰河四世纪重写基于内网的web dns 客户端,在此进行发布测试。

    如果您觉得软件好用,请在本站捐助我们,社区发展需要您的支持。如果您在使用中发现BUG,请加群反馈。群号:317764984,密码在本站主页。或者直接联系 QQ:306935137

程序界面如下:






安装方法

1、安装系统环境

修改 /etc/make.conf 使 mysql 依赖升级到 80 版本

#vi /etc/make.conf

DEFAULT_VERSIONS=   mysql=80
安装基础环境
 #pkg install -y php72  mysql80-server nginx

2、编译安装 bind912 dlz_mysql

#cd /usr/ports/dns/bind912/
#make config
[x] DLZ_MYSQL       DLZ MySQL driver (no threading) 
[  ] THREADS         Threading support

3、添加启动开关


#sysrc named_enable=yes
#sysrc nginx_enable=yes
#sysrc php_fpm_enable=yes
#sysrc mysql_enable=yes
调整 named 与mysql 的启动依赖关系,编辑 /usr/local/etc/rc.d/named
# PROVIDE: named
# REQUIRE: NETWORKING ldconfig syslogd mysql
# BEFORE: SERVERS
# KEYWORD: shutdown
注意 # REQUIRE: 中的 mysql 代表了在启动 named 之前启动 mysql


 4、解压web客户端到 www

#rm -fr /usr/local/www/*
#tar xvzfp dns_web.tgz  -C  /usr/local
#chown -R www:www /usr/local/www/

5、修改nginx 配置文件

#ee /usr/local/etc/nginx.conf
user  www www;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
        listen       80;
        server_name  www.ns1.com;


        location / {
            root   /usr/local/www;
            index  index.html index.htm index.php;
            if (!-e $request_filename)
            {
                rewrite ^/(.*)$ /index.php?s=$1 last;
                break;
            }
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        location ~ \.php$ {
            root           /usr/local/www;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/www$fastcgi_script_name;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            include        fastcgi_params;
        }
    }
}

6、访问 web 根据检测提示安装

#pkg install -y php72-mysqli php72-session php72-PDO php72-pdo_mysql php72-json
#service php-fpm restart
#mv /usr/local/www/dlz.conf  /usr/local/etc/namedb/
最后这一步很重要,dlz.conf 为网站根据检测环境自动生成

7、制作named 的rndc校验

#cd /usr/local/etc/namedb/
#rm -fr bind.keys  rndc.conf.sample
#rndc-confgen > rndc.conf
#cp rndc.conf rndc.key
#cp rndc.conf rndc.ctl
#vi rndc.conf 
只保留如下rndc-key 以及 options 段,主意行首不要留空格
key "rndc-key" {
        algorithm hmac-md5;
        secret "RVnl3/d+GlZlskWLSuuq6w==";
};

options {
        default-key "rndc-key";
        default-server 127.0.0.1;
        default-port 953;
};
#vi rndc.key 
只保留如下rndc-key 段,主意行首不要留空格
key "rndc-key" {
        algorithm hmac-md5;
        secret "RVnl3/d+GlZlskWLSuuq6w==";
};
#vi rndc.ctl 
只保留如下controls 段,主意行首不要留空格
controls {
        inet 127.0.0.1 port 953
                allow { 127.0.0.1; } keys { "rndc-key"; };
};

7、配置 named 支持dlz_mysql


#vi named.conf
options {
        directory       "/usr/local/etc/namedb/working";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";

        listen-on       { any; };
        allow-query     { any; };

};


zone "." { type hint; file "/usr/local/etc/namedb/named.root"; };
zone "localhost"        {
type master; file "/usr/local/etc/namedb/master/localhost-forward.db";
};
zone "127.in-addr.arpa" {
type master; file "/usr/local/etc/namedb/master/localhost-reverse.db";
};

include "/usr/local/etc/namedb/dlz.conf";
include "/usr/local/etc/namedb/rndc.key";
include "/usr/local/etc/namedb/rndc.ctl";

8、重启 named 测试


#service named start
修改 /etc/resolv.conf
#nameserver 127.0.0.1
去web 添加域名 iceage.com 并添加 www   A记录 192.168.5.11,控制台测试
#host -t A www.iceage.com
www.iceage.com has address 192.168.5.11
更新!!!
2018年09月05日更新了 MX记录审查太严格的 BUG

点击下载程序