Note: This page is under development
# setup a database
psql -h dbhost.local -U powerdns -d powerdns -a -f /usr/local/share/doc/powerdns/schema.pgsql.sql
# SOA
insert into records (domain_id, name, content, type, ttl, prio) values (1,'blog.entwicklerseite.de', 'ns1.first-ns.de postmaster.robot.first-ns.de 2016062901 3000 3000 604800 300', 'SOA', 3600, NULL);
# A
insert into records (domain_id, name, content, type, ttl, prio) values (1, 'www.blog.entwicklerseite.de', '78.46.199.146', 'A', 3600, NULL);
# MX
insert into records (domain_id, name, content, type, ttl, prio) values (1, 'blog.entwicklerseite.de', 'blog.entwicklerseite.de', 'MX', 3600, NULL);
# NS
insert into records (domain_id, name, content, type, ttl, prio) values (1, 'example.com', '127.0.0.1', 'NS', 3600, NULL);
# enable axfr for all servers with an NS entry
insert into domainmetadata (domain_id, kind, content) values (1,'ALLOW-AXFR-FROM','AUTO-NS');
Problems and solutions #
Unable to retrieve SOA for some.thing #
This error can have many causes, but basically means, that your slave cannot
reach the master. You can easily get this error if you forgot to open UDP port
53, which is confusing if your host -t axfr some.thing [dns.master.ip.address]
worked, because only TCP port 53 is open.
Tweaking the colorscheme #
The powerdns recusor has a nice web interface, but with a light theme. Here is a hacky attempt to get it dark:
@import url("styling_old.css");
.table-container { width: inherit; }
/* dark color scheme follows... */
html,body { padding:0; margin:0; overflow-x: hidden; }
body { background:#444; color:#ccc; }
div { padding: 0.5em; }
#top-stats { position: absolute; width:100%; }
div.topbar { background-color: #fff; background-position: 1em 1em; padding:1em; }
div.charts-container { color: #fff; position:absolute; right:0; }
div.table-container { margin-top: 8em; padding:0; }
table { background: #222; }
h1,h2,th { color: #e38000; text-transform: uppercase; font-family: monospace; font-size: inherit; }
h1,h2,.charts-container h2 { border-top: 6px dotted #e38000; border-left: 6px dotted #e38000; padding:0.5em; text-align: left; }
tr,td,th { padding:0.25em; }
/*
# To use this file the nginx configuration can look similar to:
server {
server_name _;
listen :80;
root /usr/local/www/powerdns-recursor-custom/;
location /local.js { }
location /styling.css { }
location /styling_old.css {
proxy_set_header X-API-Key "changeme";
proxy_pass http://pdns-recursor.local:8082/styling.css;
}
location / {
proxy_pass http://pdns-recursor.local:8082/;
}
}
*/
search dns server under 10.10.10.53
for test.example.com:
host test.example.com 10.10.10.53
use default dns server from /etc/resolv.conf
to search for example.com
:
host test.example.com
dig +short example.com
use default dns server with /etc/nsswhich logic to resolve example.com
getent hosts test.example.com
wget -O/dev/null test.example.com