amazon-linux-extras install epel -y
yum -y install mariadb-server mariadb
systemctl enable mariadb
systemctl start mariadb
mysql <<EOF
create database pdns;
grant all on pdns.* to pdnsadmin@localhost identified by '5RUc7MM73T';
flush privileges;
exit;
EOF
yum -y install pdns pdns-backend-mysql
mysql --user=pdnsadmin --password=5RUc7MM73T pdns < /usr/share/doc/pdns-backend-
mysql-4.1.14/schema.mysql.sql
vi /etc/pdns/pdns.conf
#launch=bind
launch=gmysql
gmysql-host=localhost
gmysql-user=pdnsadmin
gmysql-password=5RUc7MM73T
gmysql-dbname=pdns
api=yes
api-key=Foobar
webserver=yes
webserver-address=127.0.0.1
webserver-allow-from=127.0.0.1,::1
webserver-port=8081
systemctl enable pdns
systemctl start pdns
curl -v -H 'X-API-Key: Foobar' --data '{"name":"e164enum.net.", "kind": "Native",
"masters": [], "nameservers": ["ns1.e164enum.net."]}'
http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq .
curl -X PATCH -H 'X-API-Key: Foobar' --data '{"rrsets": [ {"name":
"ns1.e164enum.net.", "type": "A", "ttl": 86400, "changetype": "REPLACE", "records":
[ {"content": "127.0.0.1", "disabled": false } ] } ] }'
http://127.0.0.1:8081/api/v1/servers/localhost/zones/e164enum.net | jq .
curl -X PATCH -H 'X-API-Key: Foobar' --data @1.json
http://127.0.0.1:8081/api/v1/servers/localhost/zones/e164enum.net
1.json:
{
"rrsets":[
{
"name":"*.3.3.e164enum.net.",
"type":"NAPTR",
"ttl":900,
"changetype":"REPLACE",
"records":[
{
"content":"10 10 \"u\" \"E2U+pstn:tel\" \"!^(.*)$!tel:\\\\
1;npdi;user=phone!\" .",
"disabled":false
}
]
}
]
}
curl -X PATCH -H 'X-API-Key: Foobar' --data @-
http://127.0.0.1:8081/api/v1/servers/localhost/zones/e164enum.net <<EOD
{
"rrsets":[
{
"name":"3.1.3.2.3.2.5.5.7.3.3.e164enum.net.",
"type":"NAPTR",
"ttl":900,
"changetype":"REPLACE",
"records":[
{
"content":"10 10 \"u\" \"E2U+pstn:tel\" \"!^.*\$!tel:
+335134755232313;npdi;user=phone!\" .",
"disabled":false
}
]
}
]
}
EOD
curl -X PATCH -H 'X-API-Key: Foobar' --data @-
http://127.0.0.1:8081/api/v1/servers/localhost/zones/e164enum.net <<EOD
{
"rrsets":[
{
"name":"1.1.3.2.3.2.5.5.7.3.3.e164enum.net.",
"type":"NAPTR",
"ttl":900,
"changetype":"REPLACE",
"records":[
{
"content":"10 10 \"u\" \"E2U+pstn:tel\" \"!^.*\$!tel:
+335134755232311;npdi;user=phone!\" .",
"disabled":false
}
]
}
]
}
EOD
insert into records (domain_id, name, type, content, ttl, prio, disabled, auth)
values (1, '*.3.3.e164enum.net', 'NAPTR', '10 10 "u" "E2U+pstn:tel" "!^(.*)$!
tel:\\\\1;npdi;user=phone!" .', 900, 0, 0, 1);
dig +noall +answer -t naptr 3.1.3.2.3.2.5.5.7.3.3.e164enum.net @127.0.0.1
dig +noall +answer -t naptr 0.1.3.2.3.2.5.5.7.3.3.e164enum.net @127.0.0.1