Skip to main content
Glama

devns

Local domain https://<name>.test without a port for macOS.

devns add webui 8080
# ✓ https://webui.test → 127.0.0.1:8080 (caddy admin load HTTP 200)

One CLI that sets everything up: dnsmasq (wildcard *.test → 127.0.0.1), Caddy (the sole holder of ports 80/443, automatic HTTPS via internal CA), and an optional local DoH bridge so browsers with Secure DNS can still open .test domains.

Why is it needed?

Without devns

With devns

http://localhost:7337

https://pueue.test

Port conflicts between projects

Unique name per project, no port in the URL

Plain HTTP

Trusted HTTPS (secure cookies, service workers, clipboard API work)

Browser Secure DNS kills local domains

DoH bridge: .test stays local, everything else stays encrypted to the cloud

Related MCP server: Domain Checker

Install

Requirements: macOS + uv + Homebrew.

git clone https://github.com/apiep/devns && cd devns
uv tool install --editable .
devns init          # sekali saja — minta sudo interaktif 2-3x
devns doh install   # opsional: bridge DoH utk browser secure-DNS

devns init sets up:

  1. brew install dnsmasq caddy if not already installed

  2. /etc/resolver/test → macOS routes the .test TLD to 127.0.0.1

  3. address=/.test/127.0.0.1 block in dnsmasq.conf + root service on :53

  4. Main Caddyfile (import ~/.config/devns/sites/*.caddy) + root service on 80/443

  5. Caddy's internal CA added to the system trust store (sudo caddy trust)

  6. DoH bridge (dnsproxy from AdGuard — binary auto-downloaded based on OS/arch)

Day-to-day no sudo at all: add/rm/ls/open/doctor/doh/log.

Usage

devns add pueue 7337          # daftarkan domain + reload Caddy + cek port
devns add api 3000 --open     # sekalian buka browser
devns ls                      # ● https://pueue.test → 127.0.0.1:7337
devns open pueue              # buka di browser default
devns rm pueue                # hapus (konfirmasi; -y skip)
devns doctor                  # kesehatan: resolver/DNS/Caddy/HTTPS/DoH

devns doh install             # bridge DoH (LaunchAgent user-level)
devns doh status
devns doh log -f              # ikuti log dnsproxy live

Browsers with Secure DNS

After devns doh install, set Secure DNS to Custom: https://dns.test:8443/dns-query. .test queries are answered locally, all other queries are forwarded encrypted to your chosen DoH upstream (default OpenDNS).

Architecture

Browser ──DoH──> dns.test:8443 (dnsproxy, launchd io.devns.doh)
                   ├─ [/test/] ──> dnsmasq :53 ──> 127.0.0.1
                   └─ lainnya  ──> https://doh.opendns.com/dns-query

Browser ──HTTPS──> Caddy :443 ──reverse_proxy──> 127.0.0.1:<port-app>
        ──HTTP───> Caddy :80  ──308──> HTTPS
                     cert: Caddy Local Authority (tls internal), per-hostname on-demand
  • Registry: ~/.config/devns/registry.yaml = the single source of truth

  • Site files: ~/.config/devns/sites/<name>.caddy (generated artifacts; the template uses flush_interval -1 so SSE is not buffered)

  • Daily reload: Caddy admin endpoint localhost:2019 with the Content-Type: text/caddyfile header

MCP server

devns ships with a stdio MCP server with no extra dependencies:

hermes mcp add devns --command devns-mcp    # Hermes Agent
# atau konfigurasi MCP client lain (Claude Desktop dsb) dengan command "devns-mcp"

Tools: list_domains, add_domain, remove_domain, check_health, doh_status.

Skill for AI agents

This repo includes a portable skill at skills/devns/SKILL.md (agentskills.io / Claude skills format). Copy or symlink it into your agent's skills directory.

Design notes (real-world lessons)

  • Wildcard *.test is rejected by modern verifiers — Chrome and curl reject a wildcard cert that attaches directly to a TLD even if the SAN is RFC-valid. That's why certs are generated per-hostname on demand by Caddy's internal CA.

  • Port 5353 is already used by mDNSResponder (Bonjour) → the DoH bridge uses 5335.

  • /etc/resolver/test makes resolution hang (not fail fast) when dnsmasq is down — that's a sign the resolver is active, not a bug.

License

MIT

Available Tools

5 tools
add_domainA

Daftarkan nama.test -> 127.0.0.1:port lalu reload Caddy. Nama harus [a-z0-9-]. Contoh: add_domain(name='webui', port=8080)

Inputs: name (required), port (required).

check_healthA

Cek kesehatan rantai devns: resolver, DNS, Caddy (admin + 80/443), HTTPS.

Inputs: no named parameters.

doh_statusC

Status bridge DoH lokal (dnsproxy via launchd).

Inputs: no named parameters.

list_domainsA

Daftar semua domain *.test terdaftar beserta port dan status port.

Inputs: no named parameters.

remove_domainB

Hapus nama.test dari registry + site Caddy, lalu reload.

Inputs: name (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: listing, adding, removing domains, checking overall health, and checking DoH status. There is no overlap or ambiguity between the tools, making selection straightforward.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with a verb_noun structure (list, add, remove, check) except 'doh_status' which is a noun phrase, but it still fits the naming style seamlessly. No mixed conventions or inconsistent verbs.

    Tool Count5/5

    Five tools cover the complete lifecycle of managing local dev domains and health monitoring without being excessive or sparse. This is well-scoped for a developer-focused DNS and Caddy management server.

    Completeness5/5

    The tool set provides full CRUD for domains (list, add, remove) plus health checks for the entire system maintenance. There are no obvious missing operations required for the stated purpose; updates can be achieved by remove/add.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables comprehensive DNS operations including lookups for various record types, reverse DNS queries, batch processing, and DNS resolution tracing. Supports multiple DNS servers with configurable caching and robust error handling.
      4
      11 npm
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude to read and manage a DNS server on the user's own machine through its HTTP API, covering stats, settings, zones, logs, users, ad blocking, cache flushing, and DNS records. Every call carries a safety level, so read actions run immediately while changes and destructive operations require explicit confirmation, with credentials kept local and downloads written to disk rather than chat.
      12
      MIT