# installing and configuring PowerDNS for use as an authoritative server on a private network
## ubuntu 20.04 on raspberry pi 4 edition
## updated 2021-03-13 by sundog <sundog@reclaim.technology>
# overview
the goal of this exercise is to set up an authoritative domain name server that listens on a VPN interface and provides lookups for custom private domains to VPN clients. to accomplish this goal, I will be installing PowerDNS' authoritative server on a raspberry pi 4 running ubuntu 20.04 that was [previously configured as a wireguard VPN server](./wg-portal_notes.md).
# initial test network configuration
the server needs to listen on 10.42.1.1:53 and provide name resolution for hosts in the .sundogistan top-level domain. see the aforementioned wireguard server setup notes for more details about the VPN configuration; this document will be concentrating solely on the configuration of the DNS server.
# setting up prerequisites
## installing the powerdns authoritative server
as PowerDNS' debian/ubuntu repositories do not provide arm64 packages I will be using the ubuntu versions, currently at 4.2.1-1
if all goes well, running `sudo systemctl status pdns` should show an active running status.
let's query it:
```
sudo apt install -y net-tools
dig a www.example.com @10.42.1.1
```
hopefully you get back an answer with status: REFUSED because we haven't set up any zones yet, and definitely not the example.com zone, but if it responds then it's running!
my partially truncated output:
```
root@bbs:~# dig a www.example.com @10.42.1.1
; <<>> DiG 9.16.1-Ubuntu <<>> a www.example.com @10.42.1.1
at this point I could start using `pdnsutil` to create a zone and populate it with some records and such, but I'm in this for the long haul and I also am lazy and like web-based interfaces, so I'm going to proceed and set up [PowerDNS-Admin](https://github.com/ngoduykhanh/PowerDNS-Admin) which provides exactly that web-based interface I'm looking for.
~~there's a big **TODO** sitting right here to walk through the configuration of connecting the admin web app to the actual pdns server's api, but that will be in the next revision so I can get this committed. more soon.~~
*note: I had to go back and revise the /etc/powerdns/pdns.d/gsqlite3.conf above to enable the webserver and api server in order to continue, so if you did this before the above todo was crossed out then double check that file's contents please.*
use the link to create an account, as the first account created will be the administrator.
once you've logged in, it will complain about needing some config
the api url should be `http://localhost:8081`
the api key is the same one you added in the pdns config file earlier.
go ahead and update the settings and voila, you are the proud operator of a web-administered authoritative DNS server for your VPN clients. congrats!