Centos服务器下如何安装Mydns及MydnsConfig
.
Mydns是一个开源的DNS服务器软件,可以运行在Linux,FreeBSD,OpenBSD和Solaris等操作系统上。Mydns可以使用MySQL数据库来存储DNS记录,并提供一个简单的Web界面来管理DNS记录。
下面介绍一下如何在CentOS服务器上安装Mydns及MydnsConfig。
1、首先,安装MySQL数据库。
yum install mysql-server
2、然后安装Mydns。
wget http://www.mydns.jp/files/mydns-1.2.8.tar.gz
tar zxvf mydns-1.2.8.tar.gz
cd mydns-1.2.8
./configure --prefix=/usr/local/mydns --with-database=mysql
make && make install
3、安装完成后,需要创建Mydns的数据库和数据表。
mysql -uroot -p
create database mydns;
grant all on mydns.* to mydns@localhost identified by "mydns";
flush privileges;
use mydns;
source ./sql/mydns.sql;
quit
4、编辑Mydns的配置文件/usr/local/mydns/etc/mydns.conf,修改如下配置项:
vi /usr/local/mydns/etc/mydns.conf
# MySQL settings
db-server localhost
db-port 3306
db-name mydns
db-user mydns
db-password mydns
# Who is allowed to query the DNS server
# Default is everybody
allow-query { any; };
# Who is allowed to update the DNS server
# Default is only localhost
#allow-update { 127.0.0.1; };
# Who is allowed to transfer zones from the DNS server
# Default is only localhost
#allow-transfer { 127.0.0.1; };
5、启动Mydns服务。
/usr/local/mydns/sbin/mydns --daemon
6、安装MydnsConfig。
wget http://www.mydnsconfig.org/files/mydnsconfig-1.1.1.tar.gz
tar zxvf mydnsconfig-1.1.1.tar.gz
cd mydnsconfig-1.1.1
./configure --prefix=/usr/local/mydnsconfig --with-mydns=/usr/local/mydns
make && make install
7、编辑MydnsConfig的配置文件/usr/local/mydnsconfig/etc/mydnsconfig.conf,修改如下配置项:
vi /usr/local/mydnsconfig/etc/mydnsconfig.conf
# MySQL settings
db-server localhost
db-port 3306
db-name mydns
db-user mydns
db-password mydns
# Who is allowed to query the DNS server
# Default is everybody
allow-query { any; };
# Who is allowed to update the DNS server
# Default is only localhost
#allow-update { 127.0.0.1; };
# Who is allowed to transfer zones from the DNS server
# Default is only localhost
#allow-transfer { 127.0.0.1; };
8、启动MydnsConfig。
/usr/local/mydnsconfig/sbin/mydnsconfig --daemon
9、访问MydnsConfig的Web界面,默认的用户名和密码都是admin。
http://ip:1053/
相关文章