VectorDNS Go Server

A lightweight Go DNS lookup microservice powered by Chi and miekg/dns.

Quick Start

# Copy env config
cp .env.example .env

# Install dependencies
go mod tidy

# Run the server
go run ./cmd/server

The server starts on http://localhost:8080.

Endpoints

Method Path Description
GET /healthz Health check
POST /api/v1/dns/lookup DNS record lookup

DNS Lookup

curl -X POST http://localhost:8080/api/v1/dns/lookup \
  -H "Content-Type: application/json" \
  -d '{"domain": "example.com", "types": ["A", "MX"]}'

If types is omitted, all 9 record types are queried (A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV).

Configuration

All config is via environment variables (or .env file):

Variable Default Description
PORT 8080 Server port
API_KEY (empty) API key for auth (disabled if empty)
CORS_ORIGINS http://localhost:3000 Comma-separated allowed origins
LOG_FORMAT text text or json

Docker

docker build -t vectordns-server .
docker run -p 8080:8080 --env-file .env vectordns-server

Tech Stack

Description
VectorDNS Toolkit Go Server
Readme 36 KiB
Languages
Go 96.2%
Dockerfile 3.8%