- π 10x Faster DNS Resolution - Optimized Go backend with smart caching beats traditional DNS servers
- π― Zero-Config Setup - Get your authoritative DNS running in under 5 minutes
- π‘ Developer-First Design - Beautiful web UI + powerful APIs for modern workflows
- π Enterprise Security - Google SSO, JWT tokens, and request validation built-in
- π Scales Effortlessly - From hobby projects to enterprise - Kubernetes ready
- π Global Performance - Bloom filters and multi-level caching for worldwide speed
- π Real-time Updates - See DNS changes instantly across all your infrastructure
- π οΈ Production Ready - Docker containers, health checks, and monitoring included
- π° Open Source & Free - No vendor lock-in, customize as needed
- βοΈ Smart Load Balancing - Weight-based traffic distribution with automatic failover
- π CNAME Flattening - APEX domain CNAME support with automatic resolution
- Weight-Based Load Balancing: Distribute traffic across multiple servers based on configurable weights
- CNAME Flattening: Support CNAME records on APEX domains with automatic A record resolution
- Multiple Record Types: Support for A, AAAA, CNAME, MX, TXT, NS, SOA, and CAA records
- Real-time Updates: Instant DNS changes propagation via Redis pub/sub
- Smart Caching: Multi-level caching with Redis and in-memory storage
- Bloom Filters: Ultra-fast zone existence checking
- Weighted Selection: Intelligent traffic distribution with customizable weights
- Automatic Failover: Health-aware DNS responses
- Modern Web UI: Intuitive React-based management interface
- RESTful APIs: Complete gRPC-based API for automation
- Real-time Monitoring: Live DNS query tracking and analytics
- User Management: Google SSO integration with role-based access
DNSARC adopts modern microservice architecture with the following core components:
- DNS Server (
dns
) - Authoritative DNS resolution service with load balancing and CNAME flattening - API Server (
api
) - Backend for web management interface - Database - PostgreSQL for storing DNS records and user data
- Cache - Redis for pub/sub event communication and caching
- Admin Panel - React Router v7 + TypeScript
- UI Components - Radix UI + Tailwind CSS
- State Management - Zustand + React Query
- Go
- Node.js
- PostgreSQL
- Redis
- Docker
- Clone Repository
git clone https://github.com/akazwz/dnsarc.git
cd dnsarc
- Start Backend Services
# Enter backend directory
cd backend
# Set environment variables
export DATABASE_URL="postgres://user:password@localhost/dnsarc?sslmode=disable"
export REDIS_URL="redis://localhost:6379"
export JWT_SECRET="your-jwt-secret"
export GOOGLE_CLIENT_ID="your-google-client-id"
export GOOGLE_CLIENT_SECRET="your-google-client-secret"
export NS1="ns1.yourdomain.com"
export NS2="ns2.yourdomain.com"
# Start API server
go run . api
# Start DNS server
go run . dns
- Start Frontend Application
# Enter frontend directory
cd frontend
# Install dependencies
pnpm install
# Start development server
pnpm dev
DNSARC supports CNAME records on APEX domains through automatic flattening:
# Traditional DNS limitation
example.com. CNAME cdn.example.com. # β Not allowed
# DNSARC with CNAME flattening
example.com. CNAME cdn.example.com. # β
Supported!
# Automatically resolved to A record for clients
How it works:
- Client queries
example.com A
- DNSARC finds CNAME record pointing to
cdn.example.com
- Server automatically resolves
cdn.example.com
to IP address - Returns A record response:
example.com A 1.2.3.4
Distribute traffic intelligently across multiple endpoints:
# Multiple A records with different weights
api.example.com. A 10.0.1.1 (weight: 70) # 70% traffic
api.example.com. A 10.0.1.2 (weight: 30) # 30% traffic
# CNAME records also support weights
www.example.com. CNAME server1.example.com. (weight: 80)
www.example.com. CNAME server2.example.com. (weight: 20)
Features:
- Configurable weights per record (0-100)
- Automatic weight calculation and distribution
- Fallback to random selection when weights are 0
- Support for both A and CNAME records
- Create Configuration Secret
# Create environment configuration file
cp backend/.env.example backend/.env
# Edit .env file with actual configuration
# Create Kubernetes secret
make secret
- Deploy Services
# Deploy backend services
make deploy
# Deploy frontend service
make deploy-frontend
- Update Services
# Update backend
make update
# Update frontend
make update-frontend
# Build backend image
make build
# Push backend image
make push
# Push frontend image
make push-frontend
# Database
DATABASE_URL=postgres://user:password@localhost/dnsarc?sslmode=disable
# Redis
REDIS_URL=redis://localhost:6379
# JWT
JWT_SECRET=your-jwt-secret
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URL=http://localhost:8080/auth/google/callback
# DNS Settings
NS1=ns1.yourdomain.com
NS2=ns2.yourdomain.com
MBOX=admin.yourdomain.com
# Frontend URL
FRONTEND_URL=http://localhost:5173
Frontend configuration via environment variables or build-time config:
# API Endpoint
VITE_API_URL=http://localhost:8080
DNSARC uses gRPC and Protocol Buffers to define APIs. Main services include:
GoogleLoginURL
- Get Google login URLWhoAmI
- Get current user information
CreateZone
- Create DNS zoneListZones
- List user's DNS zonesGetZone
- Get specific zone informationUpdateZone
- Update zone settingsDeleteZone
- Delete zone
CreateDNSRecord
- Create DNS record with weight supportListDNSRecords
- List DNS recordsUpdateDNSRecord
- Update DNS record and weightDeleteDNSRecord
- Delete DNS record
DNS Record Properties:
name
- Record name (e.g., www, api, @)type
- Record type (A, CNAME, MX, TXT, etc.)content
- Record value (IP address, domain name, etc.)weight
- Load balancing weight (0-100)ttl
- Time to live in seconds
# Generate protobuf code
make gen
# Go code linting
make lint
dnsarc/
βββ backend/ # Go backend services
β βββ cmd/ # Command line entry points
β βββ internal/ # Internal packages
β β βββ api/ # API server
β β βββ dns/ # DNS server with load balancing
β β βββ handlers/ # gRPC handlers
β β βββ models/ # Data models with weight support
β β βββ services/ # Business services
β βββ k8s/ # Kubernetes configurations
β βββ gen/ # Generated code
βββ frontend/ # React frontend application
β βββ app/ # Application source code
β βββ gen/ # Generated TypeScript code
β βββ k8s/ # Kubernetes configurations
βββ proto/ # Protocol Buffers definitions
We β€οΈ contributions! DNSARC is built by the community, for the community.
- π Report bugs - Help us improve
- π‘ Suggest features - Share your ideas
- π Improve docs - Make it easier for others
- π§ Submit PRs - Direct code contributions
- β Star the repo - Show your support!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- miekg/dns - Go DNS library
- Connect - Modern RPC framework
- React Router - React routing
- Radix UI - Accessible UI components
If you encounter issues or have questions:
- Create an Issue
- Check the Documentation
- Contact maintainers