项目作者: xkstudio

项目描述 :
DNS Web Admin Based on ISC Bind (Named)
高级语言: HTML
项目地址: git://github.com/xkstudio/DNStack.git
创建时间: 2017-04-30T07:40:49Z
项目社区:https://github.com/xkstudio/DNStack

开源协议:MIT License

下载


DNStack

DNS Web Admin Based on ISC Bind

Powered By KK Studio

Version: 1.0.0-Alpha

Overview

Dashboard

Dashboard

Domain Admin

Domain

Record

Record

Group

Group

Dependency Component

Deployment

Install Bind

  1. # Remove Bind (System)
  2. yum remove bind*
  3. # Downlaod Bind
  4. wget https://ftp.isc.org/isc/bind9/9.11.0-P5/bind-9.11.0-P5.tar.gz
  5. # Decompress
  6. tar zxf bind-9.11.0-P5.tar.gz
  7. # Configure
  8. cd bind-9.11.0-P5
  9. ./configure --prefix=/usr/local/bind \
  10. --enable-epoll \
  11. --enable-threads=no \
  12. --enable-largefile \
  13. --enable-ipv6 \
  14. --with-openssl=no \
  15. --with-readline \
  16. --with-dlz-mysql=/usr/local/mysql \
  17. --with-python=/usr/local/python2.7/bin/python2.7
  18. # Install
  19. make -j 2
  20. make install
  21. ln -s /usr/local/bind/bin/dig /usr/bin
  22. ln -s /usr/local/bind/bin/nslookup /usr/bin
  23. ln -s /usr/local/bind/sbin/named /usr/sbin
  24. ln -s /usr/local/bind/sbin/rndc /usr/sbin

Configure Named

Generate rndc.conf

  1. cd /usr/local/bind/etc
  2. ../sbin/rndc-confgen > rndc.conf

named.conf

  1. key "rndc-key" {
  2. algorithm hmac-md5;
  3. secret "kzIcztY4+xH0Px2SrsZyGQ==";
  4. };
  5. controls {
  6. inet 0.0.0.0 port 953
  7. allow { any; } keys { "rndc-key"; };
  8. };
  9. logging {
  10. channel query_log {
  11. file "/usr/local/bind/var/log/query.log" versions 1024 size 100m;
  12. severity info;
  13. print-category no;
  14. print-severity no;
  15. print-time yes;
  16. };
  17. category queries { query_log; };
  18. };
  19. options {
  20. listen-on port 53 { any; };
  21. listen-on-v6 { none; };
  22. directory "/usr/local/bind/var";
  23. pid-file "run/named.pid";
  24. dump-file "cache_dump.db";
  25. statistics-file "named.stats";
  26. memstatistics yes;
  27. memstatistics-file "named.memstats";
  28. allow-query { any; };
  29. forwarders { 114.114.114.114; 8.8.8.8; };
  30. };
  31. //statistics-channels {
  32. // inet 0.0.0.0 port 8053 allow { any; };
  33. //};
  34. include "/usr/local/bind/etc/local.zone.conf";
  35. //include "/usr/local/bind/etc/zone.conf";
  36. include "/usr/local/bind/etc/dlz_mysql.conf";

dlz_mysql.conf

  1. dlz "mysql zone" {
  2. database "mysql
  3. {host=127.0.0.1 dbname=dnstack ssl=false port=3306 user=test pass=test}
  4. {select zone from domain where status = 1 and zone = '$zone$' limit 1}
  5. {select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"') when lower(type) = 'soa' then concat_ws(' ', data, resp_person, serial, refresh, retry, expire, minimum) else data end from record where status = 1 and zone = '$zone$' and host ='$record$'}";
  6. };

Start Named

named -c /usr/local/bind/etc/named.conf

Control Named

  • Get Running Status

rndc status

  • Reload

rndc reload

  • Reload config file

rndc reconfig

  • Shutdown Name

rndc halt

Configure Database

Create a database

mysql> create database dnstack;

Import SQL

mysql dnstack < docs/data.sql

Config file config/settings.py

  1. config = {
  2. 'db': {
  3. 'host': '127.0.0.1',
  4. 'port': 3306,
  5. 'db': 'dnstack',
  6. 'user': 'test',
  7. 'passwd': 'test',
  8. 'charset': 'utf8'
  9. },
  10. 'redis': {
  11. 'host': '127.0.0.1',
  12. 'port': 6379,
  13. 'password': '',
  14. 'db': '0'
  15. },
  16. ......
  17. }

Startup

python run.py

You can visit the site via http://YourIP:8888/

Specify Port:

python run.py —port=8081

Get Support and Help

To report an issue with DNStack.

https://github.com/kkstu/DNStack/issues

Contributors

After the version 1.0-Stable release.

Technology Communications

Wechat

Python运维圈

QQ Group

459457262

Development Team

http://studio.luxiaok.com

License

This project is under the MIT License. See the LICENSE file for the full license text.