Difference between revisions of "Powerdns Install"
Jump to navigation
Jump to search
Line 58: | Line 58: | ||
$ dig +short example.com MX @127.0.0.1 | $ dig +short example.com MX @127.0.0.1 | ||
25 mail.example.com | 25 mail.example.com | ||
+ | ``` | ||
+ | |||
+ | db test | ||
+ | ``` | ||
+ | psql -U pdns -h 127.0.0.1 -W pdns | ||
``` | ``` |
Revision as of 00:19, 17 November 2020
https://www.howtoforge.com/how-to-install-powerdns-admin-on-ubuntu-20-04/
https://doc.powerdns.com/authoritative/guides/basic-database.html
sudo -i -u postgres psql -c "CREATE ROLE pdns WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'pdns'" sudo -i -u postgres createdb -O pdns pdns sudo psql -U pdns -W -h 127.0.0.1 pdns < /usr/share/pdns-backend-pgsql/schema/schema.pgsql.sql sudo psql -U pdns -W -h 127.0.0.1 pdns < /root/luadns.sql cp -p /usr/share/doc/pdns-backend-pgsql/examples/pdns.local.gpgsql.conf /etc/powerdns/pdns.d/
/etc/powerdns/pdns.d/pdns.local.gpgsql.conf
# PostgreSQL Configuration # # Launch gpgsql backend launch+=gpgsql # gpgsql parameters gpgsql-host=127.0.0.1 gpgsql-port=5432 gpgsql-dbname=pdns gpgsql-user=pdns gpgsql-password=pdns gpgsql-dnssec=yes
/etc/powerdns/pdns.conf
enable-lua-records=yes
sql
mysql> INSERT INTO domains (name, type) values ('example.com', 'NATIVE'); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'example.com','localhost admin.example.com 1 10380 3600 604800 3600','SOA',86400,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'example.com','dns-us1.powerdns.net','NS',86400,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'example.com','dns-eu1.powerdns.net','NS',86400,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'www.example.com','192.0.2.10','A',120,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'mail.example.com','192.0.2.12','A',120,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'localhost.example.com','127.0.0.1','A',120,NULL); INSERT INTO records (domain_id, name, content, type,ttl,prio) VALUES (1,'example.com','mail.example.com','MX',120,25);
test
$ dig +short www.example.com @127.0.0.1 192.0.2.10 $ dig +short example.com MX @127.0.0.1 25 mail.example.com
db test
psql -U pdns -h 127.0.0.1 -W pdns