NamedManager安装Web管理bind9的DNS服务器

一、NamedManager 介绍

NamedManager is an AGPL web-based DNS management system designed to make the adding, adjusting and removal of zones/records easy and reliable.

This also ensures that an outage of the management server web interface or SQL database will not result in any impact to DNS servers.

Key Features

  • Allows addition, adjusting and deletion DNS zones.
  • Supports Bind 9 and pushes Bind compatible configuration and zone files to configured servers.
  • Supports Amazon Route53
  • Ability to import from Bind zonefile support.
  • Includes a log tailer that runs on the name servers and sends back logs that are rendered in the web interface.
  • SOAP API to allow other tools to hook into the interface.
  • Written in PHP and uses a MySQL database backend.
  • Supports IPv4 and IPv6 users of the management interface.
  • Supports IPv4 and IPv6 forward and reverse records zones.
  • Supports internationalized domain names.

Using NamedManager

NamedManager is split into two parts:

  1. The web interface and MySQL DB that stores and provides configuration for the DNS zones.
  2. A component for bind which runs frequently and applies any configuration on the Bind name servers, eloads them and sends logs back to the web interface.

You should (really should!) have at least two name servers, one model that works well is to have a master name server that runs the NamedManager interface and two slave servers that are public facing.

With NamedManager, the usual Bind slave replication isn‘t used for zones, instead all the servers run as independents and NamedManager handles the replication of configuration between them.

更多信息请参考官方wiki: https://github.com/jethrocarr/namedmanager/wiki

二、NamedManager 安装

Installation

NamedManager is split into two key components:

  • Management web interface
  • Bind server integration component

These packages have a documented installation process, however it presumes a level of understanding and familiarity with Bind name servers and Linux administration.

The easiest way to install is to use RHEL (or a clone such as CentOS, Scientific Linux, Oracle Enterprise Linux, etc) and use the RPM package process as it saves considerable steps.

Requirements

NamedManager‘s web interface requires:

  • PHP 5.3+ (php, php-soap, php-mysql, php-intl, php-xml)
  • MySQL Server

The NamedManager Bind integration requires:

  • Bind 9
  • PHP 5.3+ (php-cli, php-soap, php-intl).

1. Preparation

Before installing NamedManager, make sure you have:

a) A functional Apache server setup with PHP 5 installed and SSL enabled.

b) A MySQL database server for storing the application‘s settings and cache DB.

c) One or more functional bind name servers (can be same or different hosts to the web interface). It is recommended that you use the "bind-chroot" package on RHEL systems.

d) Check the PHP version shipped with your distribution - RHEL 5 ships with PHP 5.1.x by default, ensure that this is upgraded to 5.3 by using the newer PHP packages from amberdms-upgrades OR by installing php53 packages provided by the distribution.

# cd /etc/yum.repos.d/
# wget http://repos.amberdms.com/config/centos/6/amberdms-c6-public.repo
# yum makecache

# yum -y install namedmanager-www

2. Install the MySQL database

When you install the RPM as per the steps above, it will advise you on the command to run to install the database.

This will execute a script that allows you to specific your MySQL root password (if any) and then sets up a new DB and user for NamedManager.

3. Write the configuration file

The configuration file will be automatically generated with all the options needed to get up and running by the installer. Note that the installer only contains the minimal key values, most of the options for configuration are exposed via the web interface.

All configuration is in the /etc/namedmanager/config.php file.

By default internal application authentication is used, optionally it can be switched to use LDAP - refer to Installation-Integration-LDAP for instructions on how to do this.

4. Login and setup the name servers.

Before you can configure any domain names and records, it‘s necessary to login to the web interface and configure your name servers.

NamedManager requires all the name servers to have an entry in NamedManager - this information is used to generate NS records for all the domains, as well as being where the API keys are set to allow the name servers to connect to NamedManager for pulling configuration.

The default login is username "setup", password "setup123". The application installs default Apache configuration to run at https://localhost/namedmanager.

5. (optional) Install the Bind integration modules

For each Bind nameserver being used, the namedmanager-bind RPM package needs to be installed. This step is optional and only needed if you want to use Bind with NamedManager.

This package provides two components:

  • Configuration generation script which connects to the NamedManager web interface via SOAP and downloads the latest configuration and writes to Bind zonefiles and config files.
  • The log feeder script which installs a bootscript that monitors logs and pushes them back into NamedManager.

1. 系统初始化

关闭SELinux

# setenforce 0

# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config

2. 安装LAMP环境

#安装lamp环境
# yum -y install mysql mysql-server mysql-devel httpd php php-mysql wget make gcc 

# service httpd start
# servicemysqld start
# chkconfig httpd on
# chkconfig mysqld on

# mysqladmin -u root password sjtest123

##配置系统主机名,httpd的servername名,类似ns1.example.com
修改/etc/httpd/conf/httpd.conf
ServerName dns.test.com:80

3. named

# yum -y install bind*
# chkconfig named on

# named配置文件
# cp -R /usr/share/doc/bind-9.8.2/sample/* /var/named/chroot/ 
# echo > /var/named/chroot/etc/named.conf
# vi /var/named/chroot/etc/named.conf
options{
    listen-on port 53 { any; };
    directory  "/var/named";
    dump-file  "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query { any; };
    allow-query-cache     { any; };
    recursion  yes;

    forward first;
    forwarders { 114.114.114.114;8.8.8.8; };
    querylog 0;
    recursive-clients 50000;
    
    dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
        bindkeys-file "/etc/named.iscdlv.key";
 
        managed-keys-directory "/var/named/dynamic";
};

    logging{
    channel default_debug{
    file "data/named.run";
    severity dynamic;
    };

};

    zone "." IN {
       type hint;
       file "named.ca";
    };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named.namedmanager.conf";

## 启动bind服务
# service named start

*******************************************************************************************************************

如果要bind可以在chroot的模式下运行

yum install bind-chroot

建立“/etc/named.namedmanager.conf”文件的硬连接

ln /etc/named.namedmanager.conf  /var/named/chroot/etc/named.namedmanager.conf

如果不建立硬连接named启动时,会提示找不到“/etc/named.namedmanager.conf”。

这是因为:

bind-chroot是bind的一个功能,使bind可以在一个chroot的模式下运行。也就是说,bind运行时的/(根)目录,并不是系统真正的/(根)目录,只是系统中的一个子目录而已。这样做的目的是为了提高安全性。因为在chroot的模式下,bind可以访问的范围仅限于这个子目录的范围里,无法进一步提升,进入到系统的其他目录中。

chroot可以改变程序运行时所参考的根目录(/)位置,即将某个特定的子目录作为程序的虚拟根目录,并且对程序运行时可以使用的系统资源,用户权限和所在目录进行严格控制,程序只在这个虚拟的根目录下具有权限,一旦跳出该目录就无任何权限。例如在centos中,/var/name/chroot实际上是根目录(/)的虚拟目录,所以虚拟目录中的/etc目录实际上是/var/named/chroot/etc目录,而/var/named目录实际上是/var/named/chroot/var/named目录。chroot功能的优点是:如果有黑客通过Bind侵入系统,也只能被限定在chroot目录及其子目录中,其破坏力也仅局限在该虚拟目录中,不会威胁到整个服务器的安全。

************************************************************************************************************

4. 安装namedmanager

# cd /etc/yum.repos.d/
# wget http://repos.amberdms.com/config/centos/6/amberdms-c6-public.repo
# yum -y install namedmanager-www namedmanager-bind
# chkconfig --level 35 namedmanager_logpush on 
# chown named:root /etc/named.namedmanager.conf

## 初始化数据
# cd /usr/share/namedmanager/resources/
# ./autoinstall.pl                        #输入mysql的passwd

[[email protected] resources]# ./autoinstall.pl 
autoinstall.pl

This script setups the NamedManager database components:
 * NamedManager MySQL user
 * NamedManager database
 * NamedManager configuration files

THIS SCRIPT ONLY NEEDS TO BE RUN FOR THE VERY FIRST INSTALL OF NAMEDMANAGER.
DO NOT RUN FOR ANY OTHER REASON

Please enter MySQL root password (if any): 123456
Searching ../sql/ for latest install schema...
../sql//version_20131222_install.sql is the latest file and will be used for the install.
Importing file ../sql//version_20131222_install.sql
Creating user...
Updating configuration file...
DB installation complete!

You can now login with the default username/password of setup/setup123 at http://localhost/namedmanager

## crontab -e加入:
* * * * * /usr/bin/php -q /usr/share/namedmanager/bind/namedmanager_bind_configwriter.php >> /var/log/namedmanager_bind_configwriter

5. 配置namemanager

#配置namedmanager
# vi/etc/named.conf加入:
include "/etc/named.namedmanager.conf";
vi /etc/namedmanager/config-bind.php      # 更改相关项:
$config["api_url"] = "
["api_server_name"] = "ns1.example.com";   //此处必须与web配置里的NameServer名称一致
$config["api_auth_key"] = "mykey";

#namedmanager的web管理
https://xx.xx.xx.xx/namedmanager
默认用户名和密码分别为:setup 和 setup123

NewServer里:
addnewserver:
    Name Server FQDN *  :  ns1.example.com        //这个也写在了apache
的servername里
    Primary Nameserver * : 勾上
    API Authentication Key * : mykey

Domains/Zones里:
add new domain:
    Domain Type * : Standard Domain
    Email Administrator Address * : 你的mail

Configuration
    DEFAULT_HOSTMASTER : [email protected]
    ADMIN_API_KEY : mykey
时间: 2024-08-06 16:01:49

NamedManager安装Web管理bind9的DNS服务器的相关文章

Dnsmasq安装与配置-搭建本地DNS服务器 更干净更快无广告DNS解析

默认的情况下,我们平时上网用的本地DNS服务器都是使用电信或者联通的,但是这样也导致了不少的问题,首当其冲的就是上网时经常莫名地弹出广告,或者莫名的流量被消耗掉导致网速变慢.其次是部分网站域名不能正常被解析,莫名其妙地打不开,或者时好时坏. 如果碰上不稳定的本地DNS,还可能经常出现无法解析的情况.除了要避免"坏"的DNS的影响,我们还可以利用DNS做些"好"事,例如管理局域网的DNS.给手机App Store加速.纠正错误的DNS解析记录.保证上网更加安全.去掉网

server 2008r2 rabbitmq 安装web管理

在server 20008 r2 安装完之后打开 localhost:15672 显示无法找到网页 因为默认web管理没有启用 需要启用下,启用过程 1:打开rabbbitrq命令 (开始菜单rabbitmq文件夹下) 2:依次输入 (1)rabbitmq-plugins enable rabbitmq_management (2)rabbitmq-service stop (3)rabbitmq-service install (4)rabbitmq-service start 然后在打开就可

《Windows服务器配置与管理》搭建DNS服务器

公司名称是abc公司,搭建DNS服务器. 总公司在北京,总公司的注册的域名为HT.com.你公司下属两个分支,第一个为亚洲公司(Asia),公司总部在北京,第二个为欧洲公司(Europe),请你在总公司上建立一台DNS服务器,设计你总司和分支机构的DNS名称解析工作. 总公司:一台WEB服务器,在Internet上发布公司站点 IP地址为21.21.21.21 一台FTP服务器,负责对内网的FTP服务 IP地址为192.168.1.2/24 亚洲分公司:独立的WEB服务器,IP地址为192.16

Linux安装web管理界面-Webmin控制面板

1.下载相应的软件包 http://www.webmin.com/download.html 官网 [[email protected] ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.770-1.noarch.rpm [[email protected] ~]# rpm -vih webmin-1.770-1.noarch.rpm [[email protected] ~]# yum -y install openss

每日一记:DNS服务器

主机名控制者: DNS 服务器在私有网域内部,最好将所有的私有IP与主机名对应都写入 /etc/hosts 档案中DNS是一种因特网的通讯协议名称,而Bind则是提供这个DNS服务的软件 完整主机名(Fully Qualified Domain Name)FQDN :由主机名和域名组成 每个上一层的DNS服务器所记录的信息,其实只有其下一层的主机名而已至于再下一层,则直接授权给下层的某部主机来管理 DNS使用的端口是:53DNS查询的时候,先是与udp查询(较快),使用udp没有办法查询到完整的

DNS服务器的基础应用及主从复制

域名系统(英文:Domain Name System,缩写:DNS)是因特网的一项服务.它作为将域名和IP地址相互映射的一个分布式数据库,能够使人更方便的访问互联网.DNS 使用TCP和UDP端口53.当前,对于每一级域名长度的限制是63个字符,域名总长度则不能超过253个字符. 简而言之,DNS的出现是为了解决人们访问各个网站时的困难,因为如果每一个web服务器都是一个固定的外网IP的话,那么我们访问时必须要在浏览器中输入如http://8.8.8.8的,这对于人类来说太难于记忆了(虽然计算机

搭建本地私有DNS服务器

目录 DNS配置参数介绍 配置NDS服务器 配置主从DNS服务器 子域DNS服务器 搭建DNS视图 一.DNS配置参数介绍 1.1 主配置文件/etc/named.conf options {...};               设定DNS服务器全局环境 listen-on port 53 {...;};    DNS服务named监听的端口和ip directory                    定义数据库文件存放的目录,即zone file的存放目录 dump-file/stati

Linux搭建DNS服务器:CentOS7

一.DNS服务器简介.1.简介.DNS(Domain Name System)域名系统.目前提供网络服务的应用使用唯一的32位的IP地址来标识,但是由于数字比较复杂.难以记忆,因此产生了域名系统(DNS),通过域名系统,可以使用易于理解和形象的字符串名称来标识网络应用(如www.baidu.com.www.taobao.com).访问互联网应用可以使用域名,也可以通过IP地址直接访问该应用,在使用域名访问网络应用时,DNS负责将域名解析为IP地址.2.DNS服务器特点.分布式的数据库:解决了数据

DNS服务器的配置与应用: BIND9 的安装与配置

3. BIND9 的安装与配置 3.1 bind简介 BIND (Berkeley Internet Name Domain)是Domain Name System (DNS) 协议的一个实现,提供了DNS主要功能的开放实现,包括 域名服务器 (named) DNS解析库函数 DNS服务器运行调试所用的工具 是一款开放源码的DNS服务器软件,由美国加州大学Berkeley分校开发和维护的, 按照ISC的调查报告,BIND是世界上使用最多最广泛的域名服务系统.不论你的邮件服务器,WEB服务器或者其