This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
internet:hosting:dyndns [2012/06/22 13:45] gcooper |
internet:hosting:dyndns [2012/06/23 12:07] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Dynamic DNS ====== | ====== Dynamic DNS ====== | ||
+ | |||
+ | FIXME We decided to just pay dyn.com for their services, but this info is still valid. | ||
+ | |||
+ | http:// | ||
http:// | http:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | http:// | ||
http:// | http:// | ||
Here we provide a dynamic DNS service using PowerDNS and MySQL. | Here we provide a dynamic DNS service using PowerDNS and MySQL. | ||
+ | |||
+ | You will also use two working name servers, presumably your own. | ||
===== Install on CentOS 5 ===== | ===== Install on CentOS 5 ===== | ||
+ | |||
+ | Here we install the packages and set the MySQL root password. | ||
< | < | ||
Line 13: | Line 25: | ||
chkconfig mysqld on | chkconfig mysqld on | ||
+ | chkconfig pdns on | ||
service mysqld start | service mysqld start | ||
mysqladmin -u root password ' | mysqladmin -u root password ' | ||
- | mysqladmin -u root -h < | + | mysqladmin -u root -h [your-server-fqdn] password ' |
+ | </file> | ||
+ | |||
+ | Now we log in to MySQL: | ||
+ | |||
+ | < | ||
+ | mysql -u root -p | ||
+ | </ | ||
+ | |||
+ | Now, at the MySQL prompt, we configure MySQL permissions. | ||
+ | |||
+ | ^MySQL User ID^Purpose^ | ||
+ | |root|Master MySQL Administrator| | ||
+ | |powerdns|PowerDNS Database User| | ||
+ | |power_admin|PowerAdmin Database User (limited)| | ||
+ | |||
+ | Adjust as necessary: | ||
+ | |||
+ | < | ||
+ | CREATE DATABASE powerdns; | ||
+ | |||
+ | GRANT ALL ON powerdns.* TO ' | ||
+ | GRANT ALL ON powerdns.* TO ' | ||
+ | GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* TO ' | ||
+ | GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* TO ' | ||
+ | FLUSH PRIVILEGES; | ||
+ | </file> | ||
+ | |||
+ | Now we create the database: | ||
+ | |||
+ | < | ||
+ | USE powerdns; | ||
+ | |||
+ | CREATE TABLE domains ( | ||
+ | id INT auto_increment, | ||
+ | name VARCHAR(255) NOT NULL, | ||
+ | master VARCHAR(128) DEFAULT NULL, | ||
+ | last_check INT DEFAULT NULL, | ||
+ | type VARCHAR(6) NOT NULL, | ||
+ | notified_serial INT DEFAULT NULL, | ||
+ | account VARCHAR(40) DEFAULT NULL, | ||
+ | primary key (id) | ||
+ | ); | ||
+ | |||
+ | CREATE UNIQUE INDEX name_index ON domains(name); | ||
+ | |||
+ | CREATE TABLE records ( | ||
+ | id INT auto_increment, | ||
+ | domain_id INT DEFAULT NULL, | ||
+ | name VARCHAR(255) DEFAULT NULL, | ||
+ | type VARCHAR(6) DEFAULT NULL, | ||
+ | content VARCHAR(255) DEFAULT NULL, | ||
+ | ttl INT DEFAULT NULL, | ||
+ | prio INT DEFAULT NULL, | ||
+ | change_date INT DEFAULT NULL, | ||
+ | primary key(id) | ||
+ | ); | ||
+ | |||
+ | CREATE INDEX rec_name_index ON records(name); | ||
+ | CREATE INDEX nametype_index ON records(name, | ||
+ | CREATE INDEX domain_id ON records(domain_id); | ||
+ | |||
+ | CREATE TABLE supermasters ( | ||
+ | ip VARCHAR(25) NOT NULL, | ||
+ | nameserver VARCHAR(255) NOT NULL, | ||
+ | account VARCHAR(40) DEFAULT NULL | ||
+ | ); | ||
+ | |||
+ | quit; | ||
+ | </ | ||
+ | |||
+ | ===== Configure PowerDNS ===== | ||
+ | |||
+ | < | ||
+ | vim / | ||
+ | </ | ||
+ | |||
+ | Add the following lines to ' | ||
+ | |||
+ | < | ||
+ | ################################# | ||
+ | # launch | ||
+ | # | ||
+ | # launch= | ||
+ | launch=gmysql | ||
+ | gmysql-host=127.0.0.1 | ||
+ | gmysql-user=powerdns | ||
+ | gmysql-password=your_powerdns_password | ||
+ | gmysql-dbname=powerdns | ||
+ | </ | ||
+ | |||
+ | Start PowerDNS: | ||
+ | |||
+ | < | ||
+ | service pdns start | ||
+ | </ | ||
+ | |||
+ | ===== Install PowerAdmin ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ==== Command Line ==== | ||
+ | |||
+ | < | ||
+ | yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext php-pear-DB php-pear-MDB2-Driver-mysql | ||
+ | </ | ||
+ | |||
+ | Start web server: | ||
+ | |||
+ | < | ||
+ | chkconfig httpd on | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Get the latest PowerAdmin and install it: | ||
+ | |||
+ | < | ||
+ | wget https:// | ||
+ | |||
+ | tar xvfz poweradmin-2.1.6.tgz | ||
+ | mv poweradmin-2.1.6 / | ||
+ | touch / | ||
+ | chown -R apache: | ||
+ | </ | ||
+ | |||
+ | ==== Using a Web Browser ==== | ||
+ | |||
+ | Begin the web install using the FQDN or the server's IP address: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ^Installation Step^Action^ | ||
+ | |Installation step 1|Choose your language| | ||
+ | |Installation step 2|Read then go to step 3| | ||
+ | |Installation step 3|Username: powerdns| | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |Installation step 4|Username: power_admin| | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |Installation step 5|Skip this step because we already set it up| | ||
+ | |Installation step 6|Read and then go to step 7| | ||
+ | |Installation step 7|Read| | ||
+ | |||
+ | ==== Finalize the Install ==== | ||
+ | |||
+ | Back at the command line: | ||
+ | |||
+ | < | ||
+ | rm -rf / | ||
+ | </ | ||
+ | |||
+ | ===== Using PowerDNS ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | ==== 403 Error on Install URL ==== | ||
+ | |||
+ | < | ||
+ | touch / | ||
+ | reboot | ||
</ | </ |