import type { Metadata } from "next"; import { Settings, ArrowRight, Shield, Globe, Gauge, Database, } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; export const metadata: Metadata = { title: "Configuration", }; function CodeBlock({ code }: { code: string }) { return (
      {code.trim()}
    
); } function EnvVar({ name, defaultVal, required, description, }: { name: string; defaultVal: string; required?: boolean; description: string; }) { return ( {name} {defaultVal ? ( {defaultVal} ) : ( )} {required ? ( required ) : ( optional )} {description} ); } export default function ConfigurationPage() { return (
{/* Header */}
Go Server Configuration

Configuration

All server configuration is done via environment variables or a{" "} .env{" "} file in the project root.

{/* .env example */} Example .env

Copy{" "} .env.example {" "} to{" "} .env {" "} to get started:{" "} cp .env.example .env

{/* Environment Variables reference */}

Environment Variables

Variable Default Description
{/* API Key Auth */}

API Key Authentication

The Go server uses a shared API key for authentication. This is intentional: the server is designed to be an internal service called only by your Next.js backend — not directly by end users.

How it works

When{" "} API_KEY {" "} is set, every request (except{" "} GET /health ) must include the header:

Requests missing or sending an incorrect key receive a{" "} 401 UNAUTHORIZED {" "} response.

Calling from Next.js

Store{" "} DNS_API_KEY {" "} as a secret environment variable in your Next.js deployment. Never expose it client-side.

{/* CORS */}

CORS

CORS is handled by{" "} go-chi/cors . Configure allowed origins via the{" "} CORS_ORIGINS {" "} variable.

Development

Production (single domain)

Production (multiple domains)

Since the Go server is an internal API called server-side by Next.js, CORS is mostly relevant for development. In production, only your Next.js server IP/domain needs access.

{/* Rate Limiting */}

Rate Limiting

Rate limiting is provided by{" "} go-chi/httprate {" "} and is enabled by default.

Current defaults
  • • Rate limiting is applied per IP address.
  • • Limits are enforced at the router middleware level.
  • • Requests exceeding the limit receive{" "} 429 Too Many Requests .
Per-API-key rate limiting Planned
When billing tiers are added, rate limits will be enforced per API key to match the user`'`s plan (free vs. pro).
  • • Free tier: limited requests per day
  • • Pro tier: higher limits, hourly checks
  • • Team tier: highest limits, shared across org
{/* Redis Caching */}

Redis Caching

Planned

DNS result caching via Redis is on the roadmap. When available, the server will check Redis before querying upstream DNS, storing results with TTL-based expiry.

Planned Redis configuration

The cache layer will use{" "} go-redis {" "} and sit as middleware before DNS resolution. A{" "} docker-compose.yml {" "} bundling the Go server with Redis will be provided.

); }