免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1146 | 回复: 0
打印 上一主题 下一主题

MyDNS安裝筆記 [复制链接]

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之上海
日期:2016-05-05 09:45:14
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-15 08:19 |只看该作者 |倒序浏览
Lab環境:VMware 模擬PC
256MB RAM 8G HDD
作業系統:CentOS 5.0
需要套件:
httpd-devel-2.2.3-6.el5.centos.1
httpd-2.2.3-6.el5.centos.1
perl-DBD-MySQL-3.0007-1.fc6
mysql-5.0.22-2.1
php-mysql-5.1.6-12.el5
mysql-server-5.0.22-2.1
mysql-devel-5.0.22-2.1
php-common-5.1.6-12.el5
php-mbstring-5.1.6-12.el5
php-5.1.6-12.el5
php-pdo-5.1.6-12.el5
php-mysql-5.1.6-12.el5
php-cli-5.1.6-12.el5

上述套件用yum安裝
下載MyDNS RPM套件
http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm
下載MyDNSConfig套件
http://www.mydnsconfig.org/downloads.htm
筆者撰文時,MyDNSConfig版本為MyDNSConfig 1.1.0
MySQL管理工具
http://www.phpmyadmin.net/home_page/index.php
自行下載適當版本

#service httpd start               #啟動Apache Server
#service mysqld start           #啟動MySQL
#chkconfig httpd on            #設定成開機自動啟動
#chkconfig mysqld on        #設定成開機自動啟動
#mysql -u root -p               #用root帳號登入MySQL Server
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE DATABASE mydns;                     
建立mydns資料庫
GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO
[email='mydns'@'localhost']'mydns'@'localhost'[/email]
IDENTIFIED BY 'mydnspassword';            
建立mydns帳號及密碼,僅供本機登入
GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO
[email='mydns'@'localhost.localdomain']'mydns'@'localhost.localdomain'[/email]
IDENTIFIED BY 'mydnspassword';      
建立mydns帳號及密碼,可由外登入
FLUSH PRIVILEGES;
quit;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
  
安裝設定phpmyadmin MySQL 管理工具
#tar jxvf phpMyAdmin-2.9.1.1-all-languages-utf-8-only.tar.bz2
mv
#vi /var/www/html/phpmyadmin/config.inc.php
---------------------------------------------------------------------------------------------------------------------------
* Servers configuration
*/
$i = 1;
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
/*
---------------------------------------------------------------------------------------------------------------------------
###測試PHPMyAdmin###
http://mydns_ip/phpmyadmin



#tar xvfz MyDNSConfig-1.1.0.tar.gz
#cd MyDNSConfig-1.1.0
安裝 MyDNSConfig:
#mkdir /usr/share/mydnsconfig
#cp -rf interface/* /usr/share/html/mydnsconfig/
#ln -s /usr/share/mydnsconfig/web/ /var/www/html/mydnsconfig

匯入MyDNSConfig SQL Database
#mysql -u root -p mydns
編輯 MyDNSConfig 設定檔
#vi /usr/share/mydnsconfig/lib/config.inc.php
----------------------------------------------------------------------------------------------------------------------------

        Database Settings
*/

$conf["db_type"]                = 'mysql';
$conf["db_host"]                = 'localhost';
$conf["db_database"]            = 'mydns';
$conf["db_user"]                = 'mydns';
$conf["db_password"]            = 'mydnspassword';
/*
----------------------------------------------------------------------------------------------------------------------------
設定MyDNS設定檔
#vi /etc/mydns.conf
----------------------------------------------------------------------------------------------------------------------------
##
##  /etc/mydns.conf
##  Wed Jan 18 17:18:48 2006
##  For more information, see mydns.conf(5).
##
                                # DATABASE INFORMATION
db-host = localhost                          # SQL server hostname
db-user = mydns                             # SQL server username
db-password = mydnspassword      # SQL server password
database = mydns                           # MyDNS database name
                                # GENERAL OPTIONS
user = nobody                               # Run with the permissions of this user
group = nobody                            # Run with the permissions of this group
listen = *                                       # Listen on these addresses ('*' for all)
no-listen =                                    # Do not listen on these addresses
                                # CACHE OPTIONS
zone-cache-size = 1024          # Maximum number of elements stored in the zone cache
zone-cache-expire = 60          # Number of seconds after which cached zones expires
reply-cache-size = 1024         # Maximum number of elements stored in the reply cache
reply-cache-expire = 30         # Number of seconds after which cached replies expire
                                # ESOTERICA
log = LOG_DAEMON                     # Facility to use for program output (LOG_*/stdout/stderr)
pidfile = /var/run/mydns.pid            # Path to PID file
timeout = 120                                  # Number of seconds after which queries time out
multicpu = 1                                    # Number of CPUs installed on your system
recursive = 168.95.1.1                     # Location of recursive resolver
allow-axfr = no                                # Should AXFR be enabled?
allow-tcp = no                                 # Should TCP be enabled?
allow-update = no                           # Should DNS UPDATE be enabled?
ignore-minimum = no                    # Ignore minimum TTL for zone?
soa-table = soa                                # Name of table containing SOA records
rr-table = rr                                    # Name of table containing RR data
soa-where =                                   # Extra WHERE clause for SOA queries
rr-where =                                     # Extra WHERE clause for RR queries
---------------------------------------------------------------------------------------------------------------------------

#serivce mydns start
#mydns
http://your_ip/mydnsconfig/

Testing
#netstat -na | grep udp                 #查看udp有無啟動
udp        0      0 123.123.123.123:53           0.0.0.0:*                       
udp        0      0 127.0.0.1:53                0.0.0.0:*            

#host
www.hinet.net
www.hinet.net
has address 61.219.38.89
www.hinet.net
has address 203.66.88.89
#host
www.cjw.xxx.com.tw
www.cjw.xxx.com.tw
is an alias for dns.cjw.avc.com.tw.
dns.cjw.avc.com.tw has address 192.168.39.245
#mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mydns
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------------+
| Tables_in_mydns  |
+----------------------+
| rr                           |
| soa                         |
| sys_datalog            |
| sys_dbsync             |
| sys_filesync            |
| sys_group               |
| sys_user                  |
+-----------------------+
7 rows in set (0.00 sec)
mysql> SELECT * FROM rr;
+----+-------------+-----------------+------------------+--------------------+--------------------+-------+-------------------------+-----------+-------------------------+-----+---------+
| id   | sys_userid  | sys_groupid    | sys_perm_user | sys_perm_group | sys_perm_other  | zone   | name                         | type        | data                           | aux | ttl          |
+----+-------------+-----------------+------------------+--------------------+--------------------+-------+-------------------------+-----------+-------------------------+-----+---------+
| 14  |          1       |           0           | riud                  | riud                    |                            |    5     | mail.cjw.avc.com.tw. | A            | 192.168.0.1               |   0   | 86400  |
| 15  |          1       |           0           | riud                  | riud                    |                            |    5     | www                          | CNAME | dns.cjw.xxx.com.tw.  |   0   | 86400  |
| 16  |          1       |           0           | riud                  | riud                    |                            |    5     | ftp                              | CNAME | dns.cjw.xxx.com.tw.  |   0   | 86400  |
| 11  |          1       |           0           | riud                  | riud                    |                            |    6     | 1                                | PTR        | dns.cjw.xxx.com.tw.  |   0   | 86400  |
| 12  |          1       |           0           | riud                  | riud                    |                            |    5     | dns.cjw.avc.com.tw.   | A            | 192.168.0.2              |   0   | 86400  |
| 13  |          1       |           0           | riud                  | riud                    |                            |    6     | 2                                | PTR        | mail.cjw.xxx.com.tw. |   0   | 86400  |
| 17  |          1       |           0           | riud                  | riud                    |                            |    5     | cjw.avc.com.tw.         | MX         | 192.168.39.246        |  10   | 86400 |
+----+-------------+-----------------+------------------+--------------------+--------------------+-------+-------------------------+-----------+-------------------------+------+--------+
7 rows in set (0.00 sec)
References.
http://mydns.bboy.net/
http://www.howtoforge.com/mydns_name_server
http://www.mydnsconfig.org/




本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/249/showart_537069.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP