A high-performance, concurrent DNS lookup API built with Go and GoFiber. It provides detailed DNS records (A, AAAA, MX, NS, TXT, CNAME) and automatically detects the DNS provider (Cloudflare, AWS, Google, etc.).
- ⚡ Concurrent Lookups: Queries all DNS record types in parallel using Goroutines for massive performance gains.
- 🏢 Provider Detection: Identifies ~50+ different DNS providers based on nameserver patterns.
- 🛡️ Reliability: Uses a custom resolver (Cloudflare 1.1.1.1) to bypass local OS resolution issues and ensure consistent low latency.
- 🐳 Docker Ready: Includes a multi-stage Dockerfile for a minimal (~15MB) production image.
- ✨ Clean Architecture: Modular and maintainable project structure, perfect for production or learning.
# Clone the repository
git clone https://github.com/corenzy/domainvalidator.git
cd domainvalidator
# Install dependencies
go mod tidy
# Run the server
go run main.go# Build and run with Docker Compose
docker-compose up --build -dPerforms a full DNS lookup for a given domain.
Request Body:
{
"domain": "google.com"
}Successful Response:
{
"success": true,
"message": "DNS lookup completed for google.com",
"lookup_time_ms": 145,
"result": {
"domain": "google.com",
"provider": {
"name": "Google Cloud DNS",
"website": "https://cloud.google.com/dns"
},
"nameservers": ["ns1.google.com", "ns2.google.com"],
"a_records": [
{ "type": "A", "value": "142.250.184.238" }
],
"mx_records": [
{ "type": "MX", "value": "smtp.google.com", "priority": 10 }
],
"txt_records": ["v=spf1 include:_spf.google.com ~all"]
}
}Returns the API status and minimal health check information.
.
├── main.go # Entrypoint (Fiber setup, routes, middleware)
├── handlers/
│ └── lookup.go # HTTP request handling & validation
├── services/
│ └── dns.go # Core concurrent DNS resolution logic
├── providers/
│ └── providers.go # Registry of ~50+ DNS providers
├── models/
│ └── models.go # Shared request/response data structures
├── Dockerfile # Multi-stage production build
└── docker-compose.yml # Local orchestration- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.