HUB
Sign inSign up

awkto/dns-gui-for-bind

By awkto

โ€ขUpdated about 1 year ago

Sleek web GUI for managing BIND DNS zones and records

ImageBuildkit cache
0

1.9K

awkto/dns-gui-for-bind repository overview

โ DNS GUI for BIND

A sleek, modern web interface for managing BIND DNS zones and records. This application combines the power of BIND9 DNS server with an intuitive Python Flask web interface, all packaged together in a convenient Docker container.

Docker Pulls GitHub Actions License

โ โœจ Features

  • ๐ŸŽจ Modern UI - Beautiful, responsive interface built with Tailwind CSS
  • ๐Ÿš€ Easy to Use - Intuitive zone and record management
  • ๐Ÿ”ง Zone Management - Create and delete DNS zones with ease
  • ๐Ÿ“ Record Management - Create, edit, and delete DNS records (A, AAAA, CNAME, MX, TXT, NS, PTR, SRV)
  • ๐Ÿณ Docker Ready - Runs BIND and the web interface together in one container
  • ๐Ÿ”„ Auto-reload - Changes are automatically applied to BIND using rndc
  • ๐Ÿฅ Health Checks - Built-in monitoring of BIND and application status
  • ๐Ÿ”Œ REST API - Full-featured API for automation and integration

โ ๐Ÿš€ Quick Start

docker run -d \
  --name dns-gui-for-bind \
  -p 53:53/tcp \
  -p 53:53/udp \
  -p 5000:5000 \
  awkto/dns-gui-for-bind:latest

Then open your browser to http://localhost:5000

โ Using Docker Compose
git clone https://github.com/awkto/dns-gui-for-bind.git
cd dns-gui-for-bind
docker-compose up -d

Access the web interface at http://localhost:5000

โ ๐Ÿ“‹ Requirements

โ For Docker Deployment
  • Docker 20.10+
  • Docker Compose 2.0+ (optional)
โ For Standalone Deployment
  • Python 3.8+
  • BIND9 DNS server
  • pip (Python package manager)

โ ๐Ÿ› ๏ธ Configuration

โ Environment Variables
VariableDefaultDescription
BIND_ZONES_DIR/etc/bind/zonesDirectory for zone files
BIND_CONFIG_FILE/etc/bind/named.conf.localBIND local configuration file
USE_RNDCtrueUse rndc for reloading BIND
PORT5000Web interface port
โ Persistent Storage

To persist your DNS zones and configurations, use Docker volumes:

docker run -d \
  --name dns-gui-for-bind \
  -p 53:53/tcp \
  -p 53:53/udp \
  -p 5000:5000 \
  -v dns-zones:/etc/bind/zones \
  -v dns-config:/etc/bind \
  awkto/dns-gui-for-bind:latest

โ ๐Ÿ“š Usage Guide

โ Creating a DNS Zone
  1. Click the "+ Add Zone" button in the Zones panel
  2. Enter the zone name (e.g., example.com)
  3. Optionally set admin email and TTL
  4. Click "Create Zone"

The zone will be created with default NS and SOA records.

โ Adding DNS Records
  1. Select a zone from the Zones panel
  2. Click "+ Add Record" in the Records panel
  3. Fill in the record details:
    • Name: Record name (e.g., www, mail, or @ for root)
    • Type: Record type (A, AAAA, CNAME, MX, TXT, etc.)
    • Value: Record value (IP address, hostname, etc.)
    • TTL: Time to live in seconds
  4. Click "Save Record"
โ Editing Records
  1. Click the edit icon (โœ๏ธ) next to any record
  2. Modify the values as needed
  3. Click "Save Record"
โ Deleting Records or Zones
  • Click the delete icon (๐Ÿ—‘๏ธ) next to a record or zone
  • Confirm the deletion

โ ๐Ÿ”Œ API Reference

โ Zones
โ List All Zones
GET /api/zones
โ Create Zone
POST /api/zones
Content-Type: application/json

{
  "zone_name": "example.com",
  "admin_email": "[email protected]",
  "ttl": 86400
}
โ Delete Zone
DELETE /api/zones/{zone_name}
โ Records
โ List Records
GET /api/zones/{zone_name}/records
โ Create Record
POST /api/zones/{zone_name}/records
Content-Type: application/json

{
  "name": "www",
  "type": "A",
  "value": "192.168.1.1",
  "ttl": 3600
}
โ Update Record
PUT /api/zones/{zone_name}/records/{record_id}
Content-Type: application/json

{
  "name": "www",
  "type": "A",
  "value": "192.168.1.2",
  "ttl": 3600
}
โ Delete Record
DELETE /api/zones/{zone_name}/records/{record_id}
โ Health Check
GET /api/health

โ ๐Ÿ—๏ธ Standalone Installation

If you prefer to run the application without Docker:

โ 1. Install BIND9
# Ubuntu/Debian
sudo apt-get install bind9 bind9utils

# CentOS/RHEL
sudo yum install bind bind-utils
โ 2. Install Python Dependencies
pip install -r requirements.txt
โ 3. Configure Environment
export BIND_ZONES_DIR=/etc/bind/zones
export BIND_CONFIG_FILE=/etc/bind/named.conf.local
export USE_RNDC=true
export PORT=5000
โ 4. Run the Application
python3 app.py

โ ๐Ÿงช Development

โ Project Structure
dns-gui-for-bind/
โ”œโ”€โ”€ app.py                  # Flask application and API routes
โ”œโ”€โ”€ bind_manager.py         # BIND management logic
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ static/
โ”‚   โ”œโ”€โ”€ index.html         # Frontend UI
โ”‚   โ””โ”€โ”€ app.js             # Frontend JavaScript
โ”œโ”€โ”€ bind-config/
โ”‚   โ”œโ”€โ”€ named.conf         # Main BIND configuration
โ”‚   โ”œโ”€โ”€ named.conf.local   # Local zones configuration
โ”‚   โ””โ”€โ”€ named.conf.default-zones  # Default zones
โ”œโ”€โ”€ Dockerfile             # Container build instructions
โ”œโ”€โ”€ docker-compose.yml     # Docker Compose configuration
โ”œโ”€โ”€ start.sh              # Container startup script
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ workflows/
        โ””โ”€โ”€ docker-build.yml  # CI/CD pipeline
โ Building from Source
git clone https://github.com/awkto/dns-gui-for-bind.git
cd dns-gui-for-bind
docker build -t dns-gui-for-bind .
docker run -d -p 53:53/tcp -p 53:53/udp -p 5000:5000 dns-gui-for-bind

โ ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

โ ๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSEโ  file for details.

โ ๐Ÿ”’ Security Considerations

  • The default configuration allows queries from any source - adjust in production
  • Consider implementing authentication for the web interface in production
  • Use firewall rules to restrict access to ports 53 and 5000
  • Regularly update the container to get security patches

โ ๐Ÿ› Troubleshooting

โ BIND won't start
  • Check configuration: named-checkconf /etc/bind/named.conf
  • Check logs: docker logs dns-gui-for-bind
  • Ensure ports 53 and 5000 are not already in use
โ Changes not taking effect
  • Verify BIND is running: rndc status
  • Check that USE_RNDC is set to true
  • Review application logs for errors
โ Web interface not accessible
  • Ensure port 5000 is not blocked by firewall
  • Check that the Flask application started successfully
  • Verify Docker port mapping is correct

โ ๐Ÿ“ง Support

โ ๐Ÿ™ Acknowledgments

  • BIND9 DNS Server by ISC
  • Flask web framework
  • Tailwind CSS for the beautiful UI
  • Docker for containerization

Made with โค๏ธ for the DNS community

Tag summary
Recent tags
Content type
Image
Digest
sha256:6f987b1abโ€ฆ
Size
168.5 MB
Last updated
about 1 year ago
docker pull awkto/dns-gui-for-bind:latest