Skip to content

awkto/DNS-GUI-for-Bind

Repository files navigation

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

Using Docker (Recommended)

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

Variable Default Description
BIND_ZONES_DIR /etc/bind/zones Directory for zone files
BIND_CONFIG_FILE /etc/bind/named.conf.local BIND local configuration file
USE_RNDC true Use rndc for reloading BIND
PORT 5000 Web 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

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published