88 lines
2.6 KiB
Markdown
88 lines
2.6 KiB
Markdown
# PowerDNS Docker Setup
|
|
|
|
This repository contains a Docker Compose configuration for running PowerDNS with MySQL/MariaDB backend and PowerDNS Admin web interface.
|
|
|
|
## Features
|
|
|
|
- PowerDNS authoritative DNS server with MySQL backend
|
|
- PowerDNS Admin web interface for easy domain management
|
|
- Separate MariaDB databases for PowerDNS and PowerDNS Admin
|
|
- Secure by default with dedicated database users
|
|
- Automatic container restart on failure
|
|
|
|
## Requirements
|
|
|
|
- Docker and Docker Compose
|
|
- Linux/macOS (Windows users may need to adjust volume paths)
|
|
- Port 53 available (or modify the configuration to use a different port)
|
|
|
|
## Quick Start
|
|
|
|
1. Clone this repository:
|
|
```bash
|
|
git clone https://git.jeanavril.com/jean/powerdns-docker
|
|
cd powerdns-docker
|
|
```
|
|
|
|
2. Generate secure passwords and create your environment file:
|
|
```bash
|
|
./set-dot-env.sh
|
|
```
|
|
|
|
3. Start the containers:
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
4. Access PowerDNS Admin at http://your-server-ip:8080
|
|
|
|
## Configuration
|
|
|
|
All configuration is handled through environment variables in the `.env` file. A sample file is provided as `.env.sample`.
|
|
|
|
Key configurations:
|
|
- `PDNS_PORT`: DNS server port (default: 53)
|
|
- `PDNS_API_KEY`: API key for PowerDNS (used by Admin interface)
|
|
- `PDNS_WEBSERVER_PORT`: Port for PowerDNS API webserver
|
|
- `PDNS_ADMIN_PORT`: Port for PowerDNS Admin web interface
|
|
|
|
## Initial PowerDNS Admin Setup
|
|
|
|
1. Access the PowerDNS Admin web interface at http://your-server-ip:8080
|
|
2. Create a new admin user account
|
|
3. Configure the PowerDNS server connection:
|
|
- URL: http://pdns:8081/
|
|
- API Key: The value of `PDNS_API_KEY` from your `.env` file
|
|
|
|
## Security Notes
|
|
|
|
- Default configuration allows API access from all IP addresses
|
|
- For production use, restrict `PDNS_webserver_allow_from` to specific IPs
|
|
- All passwords are stored in the `.env` file - keep this file secure
|
|
- Database files are stored as Docker volumes in the project directory
|
|
|
|
## Backup
|
|
|
|
To backup your DNS data:
|
|
1. Backup the MariaDB data directories:
|
|
```bash
|
|
tar czf pdns-backup-$(date +%Y%m%d).tar.gz pdns-mysql-data pdns-admin-mysql-data
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
- If you can't access the PowerDNS Admin interface, check if port 8080 is open
|
|
- If DNS resolution fails, verify that port 53 is not in use by another service
|
|
- Check container logs with `docker-compose logs pdns` or `docker-compose logs pdns-admin`
|
|
|
|
## Maintenance
|
|
|
|
To update containers to the latest version:
|
|
```bash
|
|
docker-compose pull
|
|
docker-compose up -d
|
|
```
|
|
|
|
---
|
|
|
|
This setup is configured for ease of use. For production environments, consider implementing additional security measures and backup strategies. |