CentOS7 Bind DNS Server Installation

1 Host Preparation

1.1 Disable SeLinux

[root@dns ~]# setenforce 0
[root@dns ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

1.2 Shutdown firewall

[root@dns ~]# systemctl stop firewalld
[root@dns ~]# systemctl disable firewalld

2 Install PHP + Mysql

2.1 Install Mysql

2.1.1 UnInstall the existing mysql or mariadb.

[root@dns ~]# rpm -qa | grep -i mysql | xargs rpm -e --allmatches --nodeps 
warning: /etc/yum.repos.d/mysql-community.repo saved as /etc/yum.repos.d/mysql-community.repo.rpmsave
[root@dns ~]# 

2.1.2 Install the latest mysql version

[root@dns ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
[root@dns ~]# yum localinstall mysql57-community-release-el7-11.noarch.rpm 
[root@dns resources]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community                  45
mysql-tools-community/x86_64      MySQL Tools Community                       59
mysql57-community/x86_64          MySQL 5.7 Community Server                 247
[root@dns resources]# yum repolist all | grep mysql
mysql-cluster-7.5-community/x86_64 MySQL Cluster 7.5 Community   disabled
mysql-cluster-7.6-community/x86_64 MySQL Cluster 7.6 Community   disabled
mysql-connectors-community/x86_64  MySQL Connectors Community    enabled:     45
mysql-tools-community/x86_64       MySQL Tools Community         enabled:     59
mysql-tools-preview/x86_64         MySQL Tools Preview           disabled
mysql55-community/x86_64           MySQL 5.5 Community Server    disabled
mysql56-community/x86_64           MySQL 5.6 Community Server    disabled
mysql57-community/x86_64           MySQL 5.7 Community Server    enabled:    247
mysql80-community/x86_64           MySQL 8.0 Community Server    disabled
[root@dns ~]# yum install mysql-community-server

2.1.3 Start Mysql

[root@dns ~]# systemctl start mysqld
[root@dns ~]# systemctl enable mysqld
[root@dns ~]# grep 'temporary password' /var/log/mysqld.log
2018-03-20T07:16:17.630381Z 1 [Note] A temporary password is generated for root@localhost: jWrVwB(ex0wD
[root@dns ~]# mysql -uroot -p
[root@dns ~]# ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

2.2 Install PHP

2.2.1 Uninstall the existing PHP

[root@dns ~]# 
[root@dns ~]# 
[root@dns ~]# rpm -qa | grep -i php | xargs rpm -e --allmatches --nodeps 

2.2.2 Install PHP

[root@dns ~]# yum -y install epel-release
[root@dns ~]# yum -y install php php-fpm
[root@dns ~]# php -v
PHP 5.4.16 (cli) (built: Mar  7 2018 13:34:47) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

2.2.3 Install PHP-MySQL

[root@dns ~]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.oit.uci.edu
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: repo1.sea.innoscale.net
 * updates: mirrors.cat.pdx.edu
 * webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.4.16-43.el7_4.1 will be installed
--> Processing Dependency: php-pdo(x86-64) = 5.4.16-43.el7_4.1 for package: php-mysql-5.4.16-43.el7_4.1.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php-mysql-5.4.16-43.el7_4.1.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php-mysql-5.4.16-43.el7_4.1.x86_64
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.21-1.el7 will be installed
---> Package php-pdo.x86_64 0:5.4.16-43.el7_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                                         Arch                       Version                               Repository                             Size
==============================================================================================================================================================
Installing:
 php-mysql                                       x86_64                     5.4.16-43.el7_4.1                     updates                               101 k
Installing for dependencies:
 mysql-community-libs-compat                     x86_64                     5.7.21-1.el7                          mysql57-community                     2.0 M
 php-pdo                                         x86_64                     5.4.16-43.el7_4.1                     updates                                99 k

Transaction Summary
==============================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 2.2 M
Installed size: 9.6 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): php-pdo-5.4.16-43.el7_4.1.x86_64.rpm                                                                                            |  99 kB  00:00:00     
(2/3): php-mysql-5.4.16-43.el7_4.1.x86_64.rpm                                                                                          | 101 kB  00:00:00     
(3/3): mysql-community-libs-compat-5.7.21-1.el7.x86_64.rpm                                                                             | 2.0 MB  00:00:04     
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         514 kB/s | 2.2 MB  00:00:04     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-community-libs-compat-5.7.21-1.el7.x86_64                                                                                            1/3 
  Installing : php-pdo-5.4.16-43.el7_4.1.x86_64                                                                                                           2/3 
  Installing : php-mysql-5.4.16-43.el7_4.1.x86_64                                                                                                         3/3 
  Verifying  : php-pdo-5.4.16-43.el7_4.1.x86_64                                                                                                           1/3 
  Verifying  : php-mysql-5.4.16-43.el7_4.1.x86_64                                                                                                         2/3 
  Verifying  : mysql-community-libs-compat-5.7.21-1.el7.x86_64                                                                                            3/3 

Installed:
  php-mysql.x86_64 0:5.4.16-43.el7_4.1                                                                                                                        

Dependency Installed:
  mysql-community-libs-compat.x86_64 0:5.7.21-1.el7                                     php-pdo.x86_64 0:5.4.16-43.el7_4.1                                    

Complete!
[root@dns ~]# 
[root@dns ~]# php -i | grep client
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
MYSQL_LIBS => -L/usr/lib64/mysql -lmysqlclient 
[root@dns ~]# 
[root@dns ~]# php -i | grep Client
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
Client API version => 5.6.37
Client API library version => 5.6.37
Client API header version => 5.5.56-MariaDB
Client API version => 5.6.37
[root@dns ~]# 

Here, you will find the Mysql Header version mismatch with the lib version. We will get "Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50547 Library:50631" this error.
So we need to update the php-mysql client.

[root@dns ~]# yum remove php-mysql
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.4.16-43.el7_4.1 will be erased
--> Processing Dependency: php-mysql for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Running transaction check
---> Package namedmanager-www.noarch 0:1.9.0-2.el7.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                                Arch                         Version                                   Repository                                Size
==============================================================================================================================================================
Removing:
 php-mysql                              x86_64                       5.4.16-43.el7_4.1                         @updates                                 232 k
Removing for dependencies:
 namedmanager-www                       noarch                       1.9.0-2.el7.centos                        @jethrocarr-custom                       9.0 M

Transaction Summary
==============================================================================================================================================================
Remove  1 Package (+1 Dependent package)

Installed size: 9.2 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : namedmanager-www-1.9.0-2.el7.centos.noarch                                                                                                 1/2 
NamedManager has been removed, but the MySQL database and user will need to be removed manually.
  Erasing    : php-mysql-5.4.16-43.el7_4.1.x86_64                                                                                                         2/2 
  Verifying  : namedmanager-www-1.9.0-2.el7.centos.noarch                                                                                                 1/2 
  Verifying  : php-mysql-5.4.16-43.el7_4.1.x86_64                                                                                                         2/2 

Removed:
  php-mysql.x86_64 0:5.4.16-43.el7_4.1                                                                                                                        

Dependency Removed:
  namedmanager-www.noarch 0:1.9.0-2.el7.centos                                                                                                                

Complete!
[root@dns ~]# yum install php-mysqlnd -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.oit.uci.edu
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: repo1.sea.innoscale.net
 * updates: mirror.hostduplex.com
 * webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-mysqlnd.x86_64 0:5.4.16-43.el7_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                               Arch                             Version                                       Repository                         Size
==============================================================================================================================================================
Installing:
 php-mysqlnd                           x86_64                           5.4.16-43.el7_4.1                             updates                           174 k

Transaction Summary
==============================================================================================================================================================
Install  1 Package

Total download size: 174 k
Installed size: 461 k
Downloading packages:
php-mysqlnd-5.4.16-43.el7_4.1.x86_64.rpm                                                                                               | 174 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : php-mysqlnd-5.4.16-43.el7_4.1.x86_64                                                                                                       1/1 
  Verifying  : php-mysqlnd-5.4.16-43.el7_4.1.x86_64                                                                                                       1/1 

Installed:
  php-mysqlnd.x86_64 0:5.4.16-43.el7_4.1                                                                                                                      

Complete!
[root@dns ~]# php -i|grep Client  
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Client API library version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
[root@dns ~]# 
[root@dns ~]# 
[root@dns ~]# 

2.2.4 Install httpd

[root@dns ~] yum install -y httpd

3 Install namedmanager

3.1 Install namedmanager repo

May need to add the proxy setting for this repo due to the GFW.

[root@dns ~] rpm import http://repos.jethrocarr.com/jethrocarr_signing_key.gpg
[root@dns ~] wget -O /etc/yum.repos.d/jethrocarr-c7-public.repo [http://repos.jethrocarr.com/config/centos/7/jethrocarr-c7-public.repo](http://repos.jethrocarr.com/config/centos/7/jethrocarr-c7-public.repo)
[root@dns ~] 

3.2 Install namedmanager-www

[root@dns ~]# yum install -y namedmanager-www
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.oit.uci.edu
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: repo1.sea.innoscale.net
 * updates: mirror.hostduplex.com
 * webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package namedmanager-www.noarch 0:1.9.0-2.el7.centos will be installed
--> Processing Dependency: php-xml for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Processing Dependency: php-soap for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Processing Dependency: php-ldap for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Processing Dependency: php-intl for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Processing Dependency: perl-DBD-MySQL for package: namedmanager-www-1.9.0-2.el7.centos.noarch
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.el7 will be installed
---> Package php-intl.x86_64 0:5.4.16-43.el7_4.1 will be installed
---> Package php-ldap.x86_64 0:5.4.16-43.el7_4.1 will be installed
---> Package php-soap.x86_64 0:5.4.16-43.el7_4.1 will be installed
---> Package php-xml.x86_64 0:5.4.16-43.el7_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                                Arch                         Version                                    Repository                               Size
==============================================================================================================================================================
Installing:
 namedmanager-www                       noarch                       1.9.0-2.el7.centos                         jethrocarr-custom                       1.0 M
Installing for dependencies:
 perl-DBD-MySQL                         x86_64                       4.023-5.el7                                base                                    140 k
 php-intl                               x86_64                       5.4.16-43.el7_4.1                          updates                                  97 k
 php-ldap                               x86_64                       5.4.16-43.el7_4.1                          updates                                  52 k
 php-soap                               x86_64                       5.4.16-43.el7_4.1                          updates                                 158 k
 php-xml                                x86_64                       5.4.16-43.el7_4.1                          updates                                 126 k

Transaction Summary
==============================================================================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 1.6 M
Installed size: 10 M
Downloading packages:
(1/6): php-soap-5.4.16-43.el7_4.1.x86_64.rpm                                                                                           | 158 kB  00:00:00     
(2/6): perl-DBD-MySQL-4.023-5.el7.x86_64.rpm                                                                                           | 140 kB  00:00:00     
(3/6): php-intl-5.4.16-43.el7_4.1.x86_64.rpm                                                                                           |  97 kB  00:00:00     
(4/6): php-xml-5.4.16-43.el7_4.1.x86_64.rpm                                                                                            | 126 kB  00:00:00     
(5/6): namedmanager-www-1.9.0-2.el7.centos.noarch.rpm                                                                                  | 1.0 MB  00:00:01     
php-ldap-5.4.16-43.el7_4.1.x86 FAILED                                          
http://mirrors.cat.pdx.edu/centos/7.4.1708/updates/x86_64/Packages/php-ldap-5.4.16-43.el7_4.1.x86_64.rpm: [Errno 12] Timeout on http://mirrors.cat.pdx.edu/centos/7.4.1708/updates/x86_64/Packages/php-ldap-5.4.16-43.el7_4.1.x86_64.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(6/6): php-ldap-5.4.16-43.el7_4.1.x86_64.rpm                                                                                           |  52 kB  00:00:00     
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                          53 kB/s | 1.6 MB  00:00:30     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-DBD-MySQL-4.023-5.el7.x86_64                                                                                                          1/6 
  Installing : php-intl-5.4.16-43.el7_4.1.x86_64                                                                                                          2/6 
  Installing : php-xml-5.4.16-43.el7_4.1.x86_64                                                                                                           3/6 
  Installing : php-ldap-5.4.16-43.el7_4.1.x86_64                                                                                                          4/6 
  Installing : php-soap-5.4.16-43.el7_4.1.x86_64                                                                                                          5/6 
  Installing : namedmanager-www-1.9.0-2.el7.centos.noarch                                                                                                 6/6 
Reloading httpd...
Redirecting to /bin/systemctl reload httpd.service
Job for httpd.service invalid.
Run cd /usr/share/namedmanager/resources/; ./autoinstall.pl to install the SQL database.
  Verifying  : php-soap-5.4.16-43.el7_4.1.x86_64                                                                                                          1/6 
  Verifying  : php-ldap-5.4.16-43.el7_4.1.x86_64                                                                                                          2/6 
  Verifying  : php-xml-5.4.16-43.el7_4.1.x86_64                                                                                                           3/6 
  Verifying  : php-intl-5.4.16-43.el7_4.1.x86_64                                                                                                          4/6 
  Verifying  : namedmanager-www-1.9.0-2.el7.centos.noarch                                                                                                 5/6 
  Verifying  : perl-DBD-MySQL-4.023-5.el7.x86_64                                                                                                          6/6 

Installed:
  namedmanager-www.noarch 0:1.9.0-2.el7.centos                                                                                                                

Dependency Installed:
  perl-DBD-MySQL.x86_64 0:4.023-5.el7    php-intl.x86_64 0:5.4.16-43.el7_4.1    php-ldap.x86_64 0:5.4.16-43.el7_4.1    php-soap.x86_64 0:5.4.16-43.el7_4.1   
  php-xml.x86_64 0:5.4.16-43.el7_4.1    

Complete!
[root@dns ~]#

3.3 Install namedmanager-bind

[root@dns ~]# yum install namedmanager-bind
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.s.uw.edu
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.chpc.utah.edu
 * updates: mirror.hostduplex.com
 * webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package namedmanager-bind.noarch 0:1.9.0-2.el7.centos will be installed
--> Processing Dependency: php-process for package: namedmanager-bind-1.9.0-2.el7.centos.noarch
--> Running transaction check
---> Package php-process.x86_64 0:5.4.16-43.el7_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                                 Arch                         Version                                   Repository                               Size
==============================================================================================================================================================
Installing:
 namedmanager-bind                       noarch                       1.9.0-2.el7.centos                        jethrocarr-custom                       100 k
Installing for dependencies:
 php-process                             x86_64                       5.4.16-43.el7_4.1                         updates                                  56 k

Transaction Summary
==============================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 155 k
Installed size: 507 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): php-process-5.4.16-43.el7_4.1.x86_64.rpm                                                                                        |  56 kB  00:00:00     
namedmanager-bind-1.9.0-2.el7. FAILED                                          
https://repos.jethrocarr.com/pub/jethrocarr/linux/centos/7/jethrocarr-custom/x86_64/namedmanager-bind-1.9.0-2.el7.centos.noarch.rpm: [Errno 12] Timeout on https://repos.jethrocarr.com/pub/jethrocarr/linux/centos/7/jethrocarr-custom/x86_64/namedmanager-bind-1.9.0-2.el7.centos.noarch.rpm: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
(2/2): namedmanager-bind-1.9.0-2.el7.centos.noarch.rpm                                                                                 | 100 kB  00:00:01     
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         4.9 kB/s | 155 kB  00:00:31     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : php-process-5.4.16-43.el7_4.1.x86_64                                                                                                       1/2 
  Installing : namedmanager-bind-1.9.0-2.el7.centos.noarch                                                                                                2/2 

BIND/NAMED CONFIGURATION

NamedManager BIND components have been installed, you will need to install
and configure bind/named to use the configuration file by adding the
following to /etc/named.conf:

#
# Include NamedManager Configuration
#

include "/etc/named.namedmanager.conf";


NAMEDMANAGER BIND CONFIGURATION

You need to set the application configuration in /etc/namedmanager/config-bind.php

  Verifying  : php-process-5.4.16-43.el7_4.1.x86_64                                                                                                       1/2 
  Verifying  : namedmanager-bind-1.9.0-2.el7.centos.noarch                                                                                                2/2 

Installed:
  namedmanager-bind.noarch 0:1.9.0-2.el7.centos                                                                                                               

Dependency Installed:
  php-process.x86_64 0:5.4.16-43.el7_4.1                                                                                                                      

Complete!
[root@dns ~]#

4 Install bind-chroot

4.1 Install bind9

4.1.1 Install bind9

[root@dns ~]# yum install -y bind

4.1.2 Disable bind9

We will use bind-chroot to manage bind9, so need to disable bind9 itself.

[root@dns ~]# systemctl status named
[root@dns ~]# systemctl stop named
[root@dns ~]# systemctl disable named

4.2 Install bind-chroot

4.2.1 Install the bind-chroot

[root@dns ~]# yum install bind-chroot

4.2.2 Initialize the chroot env

To mount the chroot's shell script to the chroot folder.

[root@dns ~]# /usr/libexec/setup-named-chroot.sh /var/named/chroot on
[root@dns ~]# systemctl start named-chroot
[root@dns ~]# systemctl enable named-chroot
[root@dns ~]# 

4.2.3 Create needed files

[root@dns ~]# touch /var/named/chroot/var/named/data/cache_dump.db               
[root@dns ~]# touch /var/named/chroot/var/named/data/named_stats.txt             
[root@dns ~]# touch /var/named/chroot/var/named/data/named_mem_stats.txt         
[root@dns ~]# touch /var/named/chroot/var/named/data/named.run                   
[root@dns ~]# mkdir /var/named/chroot/var/named/dynamic             //create this folder if not exists 
[root@dns ~]# touch /var/named/chroot/var/named/dynamic/managed-keys.bind    

4.2.4 Change the privileges for the chroot's files

[root@dns ~]# chmod -R 777 /var/named/chroot/var/named/data                                
[root@dns ~]# chmod -R 777 /var/named/chroot/var/named/dynamic                             
[root@dns ~]# ln /etc/named.namedmanager.conf var/named/chroot//etc/named.namedmanager.conf
[root@dns ~]# chown named:named /etc/named.namedmanager.conf                               
[root@dns ~]#  
[root@dns ~]# 

5 Configure the settings

5.1 Named's settings

File Path: /var/named/chroot/etc/named.conf

[root@dns ~]# vi /var/named/chroot/etc/named.conf
options {
    listen-on port 53 { any; }; // Modify here
    listen-on-v6 port 53 { ::1; };
    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; }; // Modify here
......
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named.namedmanager.conf";  // Added this line

5.2 Bind's settings

File Path: /var/named/chroot/etc/named.conf

[root@dns ~]# vi /etc/namedmanager/config-bind.php
......
$config["api_url"]      = "http://192.168.0.21/namedmanager";           // Modify here Application Install Location
$config["api_server_name"]  = "dns.gemii.cc";               // Modify here Name of the DNS server (important: part of the authentication process)
$config["api_auth_key"]     = "dns";                    // Modify here API authentication key, this key will be used in the manager portal.
......
$config["bind"]["version"]      = "9";                  // version of bind (currently only 9 is supported, although others may work)
$config["bind"]["reload"]       = "/usr/sbin/rndc reload";      // command to reload bind config & zonefiles
$config["bind"]["config"]       = "/var/named/chroot/etc/named.namedmanager.conf";  // Modify here. configuration file to write bind config too
$config["bind"]["zonefiledir"]      = "/var/named/chroot/var/named/";           // Modify here. directory to write zonefiles too
//$config["bind"]["config"]     = "/etc/named.namedmanager.conf";   // configuration file to write bind config too
//$config["bind"]["zonefiledir"]        = "/var/named/";            // directory to write zonefiles too
                                        // note: if using chroot bind, will often be /var/named/chroot/var/named/
$config["bind"]["verify_zone"]      = "/usr/sbin/named-checkzone";      // Used to verify each generated zonefile as OK
$config["bind"]["verify_config"]    = "/usr/sbin/named-checkconf";      // Used to verify generated NamedManager configuration
......

5.3 httpd's Settings

File path: /etc/httpd/conf/httpd.conf

[root@dns ~]# vi /etc/httpd/conf/httpd.conf
......
ServerName dns.gemii.cc:80
......
<Directory />
    AllowOverride none
#    Require all denied
</Directory>
......

6 Import the DB Scripts

6.1 Configure the DB Settings

File Path: /usr/share/namedmanager/resources/autoinstall.pl

[root@dns ~]# cd /usr/share/namedmanager/resources/
[root@dns ~]# vi autoinstall.pl
.......
# default settings 
# (only need to change these if you are doing development work)
my $db_user     = "root";       # name of user to be used to create data
my $db_name     = "namedmanager";   # name of the DB to create
my $db_host     = "localhost";      # MySQL server

my $db_bs_user      = "namedmanager";   # name of the aoconf user to create
my $db_bs_password  = "1qaz!QAZ";# Modify here random_password(10); # random password to generate
......

6.2 Import DB Settings

[root@dns 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): 1qaz!QAZ
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
[root@dns resources]

6.3 Restart the Services to enable the settings

[root@dns resources]# 
[root@dns resources]# systemctl restart httpd
[root@dns resources]# systemctl restart mysqld
[root@dns resources]# systemctl restart named-chroot
[root@dns resources]# 

7 Configure the DNS Settings in the Portal

7.1 Log into the Portal

Login the portal https://192.168.0.21/namedmanager/ with setup/setup123.

image.png

7.2 Configure the NamedManager

Click "Configuration"


image.png

7.3 Add a domain

Path "Domains/zones -> View Domains, -> Add New Domain".


image.png

7.4 Add a Name Server

Path "Name Servers -> View Name Servers, -> Add Name Server".


image.png

7.4 Add A records for the domain

Path "Domains/zones -> View Domains", then select "gemii.cc", then click "domain records" .
Add the records as you need.


image.png

7.5 Add Reverse records for the domain

Path "Domains/zones -> View Domains", then click "Add New Domain".


image.png

Then you will find the reverse domain in the domain list.


image.png

Then click "Domain Records". Add the reverse records for the standard domain records.


image.png

7.5 Enable the domain records

Waiting for about 1m, or restart the "mysqld" and "named-chroot", we will get the status to be green "status_synced".

image.png

7.6 Check the dns server.

Choose one server, change the network's DNS server.

image.png
[root@lb1 network-scripts]# systemctl daemon-reload 
[root@lb1 network-scripts]# systemctl restart network
[root@lb1 network-scripts]# 
[root@lb1 network-scripts]# ping gitlab.gemii.cc
PING gitlab.gemii.cc (192.168.0.64) 56(84) bytes of data.
64 bytes from gitlab.gemii.cc (192.168.0.64): icmp_seq=1 ttl=64 time=23.7 ms
64 bytes from gitlab.gemii.cc (192.168.0.64): icmp_seq=2 ttl=64 time=38.4 ms
^C
--- gitlab.gemii.cc ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 23.775/31.136/38.497/7.361 ms
[root@lb1 network-scripts]# 
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末捂贿,一起剝皮案震驚了整個(gè)濱河市晚树,隨后出現(xiàn)的幾起案子控汉,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 212,884評論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡钩骇,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,755評論 3 385
  • 文/潘曉璐 我一進(jìn)店門骇塘,熙熙樓的掌柜王于貴愁眉苦臉地迎上來伊履,“玉大人,你說我怎么就攤上這事款违√破伲” “怎么了?”我有些...
    開封第一講書人閱讀 158,369評論 0 348
  • 文/不壞的土叔 我叫張陵插爹,是天一觀的道長哄辣。 經(jīng)常有香客問我,道長赠尾,這世上最難降的妖魔是什么力穗? 我笑而不...
    開封第一講書人閱讀 56,799評論 1 285
  • 正文 為了忘掉前任气嫁,我火速辦了婚禮当窗,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘寸宵。我一直安慰自己崖面,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,910評論 6 386
  • 文/花漫 我一把揭開白布梯影。 她就那樣靜靜地躺著巫员,像睡著了一般。 火紅的嫁衣襯著肌膚如雪甲棍。 梳的紋絲不亂的頭發(fā)上简识,一...
    開封第一講書人閱讀 50,096評論 1 291
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼七扰。 笑死奢赂,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的戳寸。 我是一名探鬼主播呈驶,決...
    沈念sama閱讀 39,159評論 3 411
  • 文/蒼蘭香墨 我猛地睜開眼拷泽,長吁一口氣:“原來是場噩夢啊……” “哼疫鹊!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起司致,我...
    開封第一講書人閱讀 37,917評論 0 268
  • 序言:老撾萬榮一對情侶失蹤拆吆,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后脂矫,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體枣耀,經(jīng)...
    沈念sama閱讀 44,360評論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,673評論 2 327
  • 正文 我和宋清朗相戀三年庭再,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了捞奕。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,814評論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡拄轻,死狀恐怖颅围,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情恨搓,我是刑警寧澤院促,帶...
    沈念sama閱讀 34,509評論 4 334
  • 正文 年R本政府宣布,位于F島的核電站斧抱,受9級特大地震影響常拓,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜辉浦,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,156評論 3 317
  • 文/蒙蒙 一弄抬、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧宪郊,春花似錦掂恕、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,882評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至丐黄,卻和暖如春斋配,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,123評論 1 267
  • 我被黑心中介騙來泰國打工艰争, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留坏瞄,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 46,641評論 2 362
  • 正文 我出身青樓甩卓,卻偏偏與公主長得像鸠匀,于是被迫代替她去往敵國和親冠胯。 傳聞我的和親對象是個(gè)殘疾皇子觉啊,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,728評論 2 351

推薦閱讀更多精彩內(nèi)容