|
1 | | -# owerDNS Authoritative Server |
| 1 | +# PowerDNS Authoritative Server |
2 | 2 |
|
3 | | -- Powerdns v 4.9.9 |
| 3 | +This is an all-in-one Docker image that includes PHP-FPM, Nginx, PowerAdmin (web interface), and PowerDNS Authoritative Server. |
| 4 | + |
| 5 | +- PowerDNS v 4.9.9 |
4 | 6 | - PowerAdmin v 4.0.4 |
| 7 | + |
| 8 | +Note: The image tag corresponds to the PowerAdmin version. Choose the tag based on the desired PowerAdmin version. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +- Docker installed on your system. |
| 13 | +- Docker Compose installed (usually comes with Docker Desktop). |
| 14 | +- Basic knowledge of running Docker containers. |
| 15 | + |
| 16 | +Note: The database (MariaDB/MySQL) must be set up separately as it is not included in this image. |
| 17 | + |
| 18 | +## Supported Databases |
| 19 | + |
| 20 | +PowerDNS supports MySQL, MariaDB, PostgreSQL, and SQLite. Configure the backend in the `PDNS_CONF` environment variable (e.g., `launch=gmysql` for MySQL/MariaDB). |
| 21 | + |
| 22 | +## Quick Start |
| 23 | + |
| 24 | +1. Create a `docker-compose.yml` file with the example below. |
| 25 | +2. Run `docker-compose up -d` to start the services in the background. |
| 26 | +3. Access PowerAdmin at `http://localhost/poweradmin` to complete the setup. |
| 27 | + |
| 28 | +## Docker Compose Example |
| 29 | + |
| 30 | +Here is a basic `docker-compose.yml` to get started: |
| 31 | + |
| 32 | +```yaml |
| 33 | +version: '3.8' |
| 34 | + |
| 35 | +services: |
| 36 | + mariadb: |
| 37 | + image: mariadb |
| 38 | + environment: |
| 39 | + MYSQL_ROOT_PASSWORD: root_pass |
| 40 | + MYSQL_DATABASE: pdns_db |
| 41 | + MYSQL_USER: pdns_user |
| 42 | + MYSQL_PASSWORD: pdns_pass |
| 43 | + |
| 44 | + powerdns: |
| 45 | + image: ghcr.io/rootshell-coder/powerdns:4.0.4 |
| 46 | + environment: |
| 47 | + PDNS_CONF: | |
| 48 | + launch=gmysql |
| 49 | + gmysql-host=mariadb |
| 50 | + gmysql-port=3306 |
| 51 | + gmysql-dbname=pdns_db |
| 52 | + gmysql-user=pdns_user |
| 53 | + gmysql-password=pdns_pass |
| 54 | + gmysql-dnssec=yes |
| 55 | + allow-axfr-ips=127.0.0.1,::1 |
| 56 | + local-address=0.0.0.0 |
| 57 | + primary=no |
| 58 | + secondary=no |
| 59 | + cache-ttl=20 |
| 60 | + distributor-threads=3 |
| 61 | + allow-dnsupdate-from=127.0.0.1,::1 |
| 62 | + ports: |
| 63 | + - "53:53/tcp" |
| 64 | + - "53:53/udp" |
| 65 | + - "80:80/tcp" |
| 66 | + depends_on: |
| 67 | + - mariadb |
| 68 | +``` |
| 69 | +
|
| 70 | +## Database Setup |
| 71 | +
|
| 72 | +After starting the containers, initialize the PowerDNS database: |
| 73 | +
|
| 74 | +1. Copy the schema file from the container: |
| 75 | +
|
| 76 | + ```bash |
| 77 | + docker cp powerdns-powerdns-1:/usr/share/doc/pdns/schema.mysql.sql ./ |
| 78 | + ``` |
| 79 | + |
| 80 | +2. Import the schema into MariaDB: |
| 81 | + |
| 82 | + ```bash |
| 83 | + docker exec -it powerdns-mariadb-1 mariadb -u pdns_user -p pdns_db < schema.mysql.sql |
| 84 | + ``` |
| 85 | + |
| 86 | + Enter password: `pdns_pass` |
| 87 | + |
| 88 | +This sets up the necessary tables. |
| 89 | + |
| 90 | +## PowerAdmin Configuration |
| 91 | + |
| 92 | +- Access PowerAdmin at `http://localhost/poweradmin` and follow the installation wizard. |
| 93 | +- For custom settings, mount `settings.php` as a volume: |
| 94 | + |
| 95 | + ```yaml |
| 96 | + volumes: |
| 97 | + - ./settings.php:/var/www/html/poweradmin/config/settings.php:ro |
| 98 | + ``` |
| 99 | +
|
| 100 | +## Post-Installation |
| 101 | +
|
| 102 | +To complete the PowerAdmin installation, remove the install directory as required by the installer: |
| 103 | +
|
| 104 | +```bash |
| 105 | +docker exec powerdns-powerdns-1 rm -rf /var/www/html/poweradmin/install |
| 106 | +``` |
| 107 | + |
| 108 | +## Usage |
| 109 | + |
| 110 | +- PowerDNS listens on port 53 for DNS queries. |
| 111 | +- PowerAdmin web interface on port 80 at `/poweradmin`. |
| 112 | +- Manage DNS zones and records via the web interface. |
0 commit comments