Difference between revisions of "Installation:Ubuntu:PowerDNS"

From PMWH2 - PHPMyWebHosting's official wiki
Jump to: navigation, search
 
(Finish)
Line 105: Line 105:
 
  bash#> sudo /etc/init.d/pdns restart
 
  bash#> sudo /etc/init.d/pdns restart
  
Confuration of PowerDNS done. [http://www.superiorpapers.com/ research papers]
+
Confuration of PowerDNS done.

Revision as of 10:37, 12 December 2012

up

On Ubuntu 7.10 Server you need to install the following packages:

  • pdns-server
  • pdns-backend-mysql (mySQL)
  • pdns-backend-pgsql (PostgreSQL)

On Ubuntu 7.10 Server use this command to install all at once: MySQL

sudo apt-get install pdns-server pdns-backend-mysql

PostgreSQL

sudo apt-get install pdns-server pdns-backend-pgsql

MySQL

/etc/powerdns/pdns.d/pmwh2.

sudo touch /etc/powerdns/pdns.d/pmwh2

and add these lines to your /etc/powerdns/pdns.d/pmwh2 file.

#
# configure your mysql database settings
#

launch=gmysql
gmysql-dbname=pmwh2
gmysql-host=localhost
gmysql-socket=/var/run/mysqld/mysqld.sock
gmysql-user=pdns_user
gmysql-password=pdns_password

#
# Don't change around past this line unless you know what you are doing
#

gmysql-basic-query=select content,ttl,prio,type,domain_id,name from pdns_records where type='%s' and name='%s'
#This is the most used query, needed for doing 1:1 lookups of qtype/name values. First %s is replaced by the ASCII representation of the qtype of the question, the second by the name.

gmysql-id-query=select content,ttl,prio,type,domain_id,name from pdns_records where type='%s' and name='%s' and domain_id=%d
#Used for doing lookups within a domain. First %s is replaced by the qtype, the %d which should appear after the %s by the numeric domain_id.

gmysql-any-query=select content,ttl,prio,type,domain_id,name from pdns_records where name='%s'
#The %s is replaced by the qname of the question.
#For doing ANY queries. Also used internally.


gmysql-any-id-query=select content,ttl,prio,type,domain_id,name from pdns_records where name='%s' and domain_id=%d
#The %s is replaced by the name of the domain, the %d by the numerical domain id.
#For doing ANY queries within a domain. Also used internally.


#The last query is for listing the entire contents of a zone. This is needed when performing a zone transfer, but sometimes also internally:
gmysql-list-query=select content,ttl,prio,type,domain_id,name from pdns_records where domain_id=%d


gmysql-master-zone-query=select master from pdns_domains where name='%s' and type='SLAVE'
#Called to determine the master of a zone.

gmysql-info-zone-query=select id,name,master,last_check,notified_serial,type from pdns_domains where name='%s'
#Called to retrieve (nearly) all information for a domain:
gmysql-info-all-slaves-query=select id,name,master,last_check,type from pdns_domains where type='SLAVE'
#Called to retrieve all slave domains

gmysql-supermaster-query=select account from supermasters where ip='%s' and nameserver='%s'
#Called to determine if a certain host is a supermaster for a certain domain name.

gmysql-insert-slave-query=insert into pdns_domains (type,name,master,account) values('SLAVE','%s','%s','%s')
#Called to add a domain as slave after a supermaster notification.

gmysql-insert-record-query=insert into pdns_records (content,ttl,prio,type,domain_id,name) values ('%s',%d,%d,'%s',%d,'%s')
#Called during incoming AXFR.

gmysql-update-serial-query=update pdns_domains set notified_serial=%d where id=%d
#Called to update the last notified serial of a master domain.

gmysql-update-lastcheck-query=update pdns_domains set notified_serial=%d where id=%d
#Called to update the last time a slave domain was checked for freshness.

gmysql-info-all-master-query=select id,name,master,last_check,notified_serial,type from pdns_domains where type='MASTER'
#Called to get data on all pdns_domains for which the server is master.

gmysql-delete-zone-query=delete from pdns_records where domain_id=%d
#Called to delete all records of a zone. Used before an incoming AXFR.

gmysql-wildcard-query=select content,ttl,prio,type,domain_id,name from pdns_records where type='%s' and name like '%s'
#Can be left blank. See above for an explanation.

gmysql-wildcard-id-query=select content,ttl,prio,type,domain_id,name from pdns_records where type='%s' and name like '%s' and domain_id=%d
#Used for doing lookups within a domain.
#Can be left blank. See above for an explanation.

gmysql-wildcard-any-query=select content,ttl,prio,type,domain_id,name from pdns_records where name like '%s'
#For doing wildcard ANY queries.

gmysql-wildcard-any-id-query=select content,ttl,prio,type,domain_id,name from pdns_records where name like '%s' and domain_id=%d
#For doing wildcard ANY queries within a domain.

PostgreSQL

comming soon

Finish

Restart PowerDNS

bash#> sudo /etc/init.d/pdns restart

Confuration of PowerDNS done.