mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
387 lines
30 KiB
HTML
387 lines
30 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>hip-0049</title>
|
|
<meta name="color-scheme" content="dark">
|
|
<style>
|
|
/* Committed to one visual world: a dark instrument panel. No light variant —
|
|
the dot field and the hairline rules only read on black, and a naive
|
|
inversion would wash both out. Every colour is painted explicitly so the page
|
|
never borrows a host background. */
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
|
|
|
|
:root{
|
|
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
|
|
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
|
|
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
|
|
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
|
|
--font-zen-pixel-square:'Zen Pixel Square',monospace;
|
|
--mono:var(--font-zen-mono);
|
|
--sans:var(--font-zen-sans);
|
|
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
|
|
--r:999px; --r-soft:14px;
|
|
}
|
|
*{box-sizing:border-box}
|
|
html{-webkit-text-size-adjust:100%}
|
|
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
|
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
|
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
|
|
|
|
/* The dot field. A halftone made of one repeating radial-gradient, faded out
|
|
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
|
|
/* No overflow clip here: the dot field is inset to the box already, and a clip
|
|
would cut off the copy-prompt menu. */
|
|
.hero{position:relative;border-bottom:1px solid var(--line)}
|
|
.hero::before{content:"";position:absolute;inset:0;
|
|
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
|
|
background-size:7px 7px;
|
|
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
pointer-events:none}
|
|
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
|
|
|
|
nav{border-bottom:1px solid var(--line)}
|
|
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
|
|
justify-content:space-between;align-items:center;gap:1rem}
|
|
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--ink);text-decoration:none;
|
|
display:inline-flex;align-items:center;gap:.6rem}
|
|
.brand i{font-style:normal;color:var(--faint)}
|
|
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
|
|
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--soft);text-decoration:none}
|
|
nav a.up:hover{color:var(--ink)}
|
|
|
|
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
|
|
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
|
|
h1 em{font-style:normal;color:var(--faint)}
|
|
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
|
|
|
|
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
|
|
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
|
|
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
|
|
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
|
|
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
|
|
line-height:1.2;font-weight:400}
|
|
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
|
|
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
|
|
.btn.solid:hover{background:#d8d8d4}
|
|
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
|
|
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
|
|
|
|
/* Copy-prompt selector. Each row copies the prompt for its own target. */
|
|
.copy{position:relative;display:inline-flex}
|
|
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
|
|
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
|
|
padding:.4rem;display:flex;flex-direction:column;
|
|
box-shadow:0 12px 32px rgba(0,0,0,.75)}
|
|
.menu[hidden]{display:none}
|
|
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
|
|
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
|
|
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
|
|
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
|
|
white-space:nowrap}
|
|
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
|
|
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
|
|
.mi:hover .mark{color:var(--ink)}
|
|
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
|
|
letter-spacing:.1em;text-transform:uppercase}
|
|
|
|
/* Works-with bar: one scrolling row, name and mark per agent. */
|
|
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
|
|
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
|
|
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
|
|
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
|
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
|
|
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
|
|
display:flex;align-items:center}
|
|
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
|
|
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
|
|
-webkit-overflow-scrolling:touch;
|
|
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
|
|
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
|
|
.bar::-webkit-scrollbar{display:none}
|
|
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
|
|
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
|
|
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
|
|
text-decoration:none;background:var(--ground)}
|
|
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
|
|
.agent .mark{width:.95rem;height:.95rem}
|
|
|
|
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
|
|
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
|
|
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
|
|
p{margin:0 0 1rem;max-width:70ch}
|
|
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
|
|
li{margin:.22rem 0}
|
|
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
|
|
text-decoration-color:var(--line-hi)}
|
|
a:hover{text-decoration-color:var(--ink)}
|
|
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
|
|
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
|
|
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
|
|
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
|
|
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
|
|
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
|
|
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
|
|
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
|
|
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
|
|
display:block;overflow-x:auto}
|
|
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
|
|
|
|
.curl{display:block;background:var(--panel);border:1px solid var(--line);
|
|
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
|
|
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
|
|
white-space:pre;line-height:1.9}
|
|
.curl b{color:var(--ink);font-weight:400}
|
|
.curl i{font-style:normal;color:var(--faint)}
|
|
|
|
/* index */
|
|
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
|
|
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
|
|
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
|
|
#q:focus{outline:none;border-color:var(--soft)}
|
|
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
|
|
text-transform:uppercase;margin:0 0 2rem}
|
|
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
|
|
padding-bottom:.45rem}
|
|
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
|
|
border-radius:var(--r-soft);text-decoration:none}
|
|
.row:hover{background:#0a0a0a}
|
|
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
|
|
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
|
|
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
|
|
color:var(--faint);font-size:.85rem}
|
|
footer a{color:var(--soft)}
|
|
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
|
|
margin:0 0 2rem;font-size:.85rem}
|
|
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
|
|
border-bottom:1px solid var(--line);padding-bottom:.4rem}
|
|
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
|
|
.fmap a:hover{text-decoration:underline}
|
|
.fmap div{color:var(--faint);line-height:1.5}
|
|
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
|
|
|
|
@media (max-width:640px){
|
|
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
|
|
.btns{gap:.5rem}
|
|
.btn{padding:.75rem 1.15rem;font-size:.68rem}
|
|
.copy,.copy .btn{width:100%;justify-content:center}
|
|
.menu{left:0;right:0;min-width:0}
|
|
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
|
|
.strip b{border-right:0;padding-right:0}
|
|
.bar{width:100%}
|
|
}
|
|
</style>
|
|
<link rel="alternate" type="text/markdown" href="/hip-0049.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/hip-0049">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/hip-0049.md
|
|
Index: https://hanzoskills.com/llms.txt
|
|
Corpus: https://hanzoskills.com/all.md
|
|
Append .md to any path for the markdown twin. -->
|
|
<body>
|
|
<nav><div class="in">
|
|
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
|
|
<a class="up" href="/">All skills</a>
|
|
</div></nav>
|
|
|
|
<div class="wrap">
|
|
<h1>hip-0049</h1><p class="lede">HIP-49: DNS Service Standard. Status Final. Hanzo architectural specification.</p><h1>HIP-0049: DNS Service Standard</h1>
|
|
<h2>Abstract</h2>
|
|
<p>This proposal defines the DNS service standard for the Hanzo ecosystem. Hanzo DNS is a managed DNS infrastructure that handles authoritative resolution for all Hanzo-operated domains, customer vanity domains, and internal service discovery within Kubernetes clusters. It provides split-horizon resolution (different answers for internal vs external queries), DNSSEC signing for tamper-proof responses, geo-aware routing for the Hanzo Edge CDN, and automatic record provisioning when services are deployed via Platform (HIP-14).</p>
|
|
<p>The system is built on <strong>CoreDNS</strong>, a Go-based, plugin-chained DNS server originally created for cloud-native environments. CoreDNS replaces the default <code>kube-dns</code> in both Hanzo Kubernetes clusters and doubles as the authoritative nameserver for public-facing domains. Custom Hanzo plugins extend CoreDNS with API-driven record management, ACME certificate orchestration, and health-aware geo-routing.</p>
|
|
<p><strong>Repository</strong>: <a href="https://github.com/hanzoai/dns">github.com/hanzoai/dns</a> <strong>Ports</strong>: 53 (DNS), 8053 (Management API) <strong>Docker</strong>: <code>ghcr.io/hanzoai/dns:latest</code> <strong>Authoritative NS</strong>: <code>ns1.hanzo.ai</code>, <code>ns2.hanzo.ai</code></p>
|
|
<h2>Motivation</h2>
|
|
<h3>The Problem</h3>
|
|
<p>Hanzo operates 40+ domains across four organizations (hanzo.ai, lux.network, zoo.ngo, pars.id) and two Kubernetes clusters. Without a unified DNS layer, domain management fragments across multiple providers and manual processes:</p>
|
|
<ol><li><strong>Registrar-level DNS management</strong>: Each domain's records are edited in a registrar web UI. A PaaS deployment that takes 30 seconds is followed by a DNS change that takes 30 minutes of human coordination.</li></ol>
|
|
<ol><li><strong>No service discovery</strong>: Pods reach each other via <code><service>.<namespace>.svc.cluster.local</code> inside the cluster. Outside, developers hardcode endpoints. When an IP changes, every hardcoded reference breaks.</li></ol>
|
|
<ol><li><strong>No geo-routing</strong>: All DNS queries resolve to the same IP regardless of location. A user in Frankfurt adds 80ms of latency hitting a New York endpoint.</li></ol>
|
|
<ol><li><strong>No DNSSEC</strong>: A compromised resolver can redirect <code>hanzo.id</code> to a phishing page. For an identity provider handling OAuth tokens, this is a compliance requirement, not a theoretical risk.</li></ol>
|
|
<ol><li><strong>Manual certificate provisioning</strong>: Wildcard TLS certificates require DNS-01 ACME challenges, which require programmatic DNS record creation. Without a DNS API, certificate renewal breaks at 3 AM.</li></ol>
|
|
<ol><li><strong>Split-horizon gap</strong>: Internal services (SQL, KV, KMS) should resolve to cluster-internal IPs from within the cluster and should not resolve at all from the public internet.</li></ol>
|
|
<h3>What Hanzo DNS Solves</h3>
|
|
<p>A single DNS service eliminates all six problems. Platform creates DNS records automatically on deploy. Internal services resolve via <code>*.<namespace>.svc</code> without touching public DNS. DNSSEC signs every zone. Geo-routing directs users to the nearest edge. Wildcard certificates renew unattended. Engineers never log in to a registrar dashboard again.</p>
|
|
<h2>Specification</h2>
|
|
<p> CAA | Certificate authority auth | <code>hanzo.ai -> 0 issue letsencrypt.org</code> | | NS | Nameserver delegation | <code>hanzo.ai -> ns1.hanzo.ai</code> |</p>
|
|
<p>DNSSEC-related types (RRSIG, DNSKEY, DS, NSEC/NSEC3) are generated automatically by the signing plugin and are not managed via the API.</p>
|
|
<h3>Management API</h3>
|
|
<p>The management API provides CRUD operations for DNS records. It runs on port 8053 and authenticates via IAM JWT tokens (HIP-26).</p>
|
|
<p><strong>Base URL</strong>: <code>http://localhost:8053/v1</code> (internal), <code>https://api.hanzo.ai/v1/dns</code> (external, via API Gateway)</p>
|
|
<h4>Endpoints</h4>
|
|
<pre><code>GET /v1/zones List all zones
|
|
GET /v1/zones/{zone} Get zone details
|
|
POST /v1/zones Create a zone
|
|
|
|
GET /v1/zones/{zone}/records List records in zone
|
|
POST /v1/zones/{zone}/records Create a record
|
|
GET /v1/zones/{zone}/records/{id} Get a record
|
|
PUT /v1/zones/{zone}/records/{id} Update a record
|
|
DELETE /v1/zones/{zone}/records/{id} Delete a record
|
|
|
|
POST /v1/zones/{zone}/records/batch Batch create/update/delete
|
|
POST /v1/zones/{zone}/verify Verify zone delegation
|
|
POST /v1/zones/{zone}/sign Trigger DNSSEC re-signing
|
|
GET /v1/zones/{zone}/export Export zone in RFC 1035 format</code></pre>
|
|
<h4>Record Schema</h4>
|
|
<pre><code class="lang-json">{
|
|
"id": "rec_abc123", "zone": "hanzo.ai", "name": "api",
|
|
"type": "A", "value": "192.0.2.10", "ttl": 300,
|
|
"geo": {
|
|
"enabled": true,
|
|
"regions": { "na": "192.0.2.10", "eu": "198.51.100.10", "ap": "203.0.113.10" }
|
|
},
|
|
"metadata": { "managed_by": "platform", "deployment_id": "dep_xyz789" }
|
|
}</code></pre>
|
|
<p>Records with <code>metadata.managed_by: "platform"</code> are owned by Platform (HIP-14) and should not be edited manually. The API warns if a user attempts to modify a platform-managed record.</p>
|
|
<h3>Automatic DNS Provisioning (Platform Integration)</h3>
|
|
<p>When Platform (HIP-14) deploys a service with custom domains, it calls the DNS management API to create or update records:</p>
|
|
<pre><code>1. Developer adds `cloud.hanzo.ai` to service domains in hanzo.yaml
|
|
2. Developer runs `hanzo deploy`
|
|
3. Platform builds and deploys the container
|
|
4. Platform calls DNS API:
|
|
POST /v1/zones/hanzo.ai/records
|
|
{ "name": "cloud", "type": "A", "value": "<load-balancer-ip>",
|
|
"metadata": { "managed_by": "platform", "deployment_id": "..." } }
|
|
5. Platform requests TLS certificate via ACME DNS-01 challenge:
|
|
POST /v1/zones/hanzo.ai/records
|
|
{ "name": "_acme-challenge.cloud", "type": "TXT",
|
|
"value": "<challenge-token>", "ttl": 60 }
|
|
6. ACME validates, certificate issued
|
|
7. Platform deletes the challenge TXT record
|
|
8. Service is live at https://cloud.hanzo.ai</code></pre>
|
|
<p>The entire flow -- deploy, DNS record, TLS certificate -- completes in under 60 seconds with no human intervention.</p>
|
|
<h3>Geo-Aware Routing</h3>
|
|
<p>For domains served by Hanzo Edge (CDN), the <code>hanzo_geo</code> plugin returns different IP addresses based on the querier's geographic location. The plugin uses a MaxMind GeoIP2 database (updated weekly) to map resolver IPs to regions.</p>
|
|
<pre><code class="lang-json">// edge.json -- geo-routing configuration
|
|
{
|
|
"api.hanzo.ai": {
|
|
"default": "192.0.2.10",
|
|
"regions": {
|
|
"NA": "192.0.2.10",
|
|
"EU": "198.51.100.10",
|
|
"AP": "203.0.113.10"
|
|
},
|
|
"healthcheck": {
|
|
"interval": "10s",
|
|
"path": "/health",
|
|
"timeout": "3s"
|
|
}
|
|
}
|
|
}</code></pre>
|
|
<p>If the nearest region's endpoint fails its health check, the plugin falls back to the next nearest region. If all regional endpoints are down, it returns the default. Health status is shared across CoreDNS instances via a lightweight gossip protocol on a dedicated UDP port (8054).</p>
|
|
<h3>DNSSEC</h3>
|
|
<p>All authoritative zones are signed with DNSSEC using ECDSAP256SHA256 (algorithm 13). This provides cryptographic proof that DNS responses have not been tampered with in transit.</p>
|
|
<p><strong>Key management</strong>:</p>
|
|
<p>| Key Type | Algorithm | Rotation | Storage | |----------|-----------|----------|---------| | KSK (Key Signing Key) | ECDSAP256SHA256 | Annual | KMS (HIP-27) | | ZSK (Zone Signing Key) | ECDSAP256SHA256 | Monthly | Local filesystem |</p>
|
|
<p>The KSK is stored in KMS because its DS record must be registered with the parent zone (the TLD registry). Rotating the KSK requires coordinating with the registrar, so it rotates infrequently. The ZSK rotates monthly via automated key rollover -- CoreDNS generates a new ZSK, signs the zone with both old and new keys during the transition period, and retires the old key after 2x the zone's maximum TTL.</p>
|
|
<p><strong>Signing flow</strong>:</p>
|
|
<pre><code>Zone data (records) --> CoreDNS dnssec plugin --> Signed zone (RRSIG records)
|
|
|
|
|
ZSK (local) + KSK (from KMS)</code></pre>
|
|
<h3>Wildcard Certificates via ACME</h3>
|
|
<p>Hanzo DNS integrates with the ACME protocol (Let's Encrypt) to automate wildcard certificate issuance. The flow uses DNS-01 challenges, which require creating a TXT record at <code>_acme-challenge.<domain></code>:</p>
|
|
<pre><code>1. Platform or Edge requests wildcard cert for *.hanzo.ai
|
|
2. ACME client calls DNS API:
|
|
POST /v1/zones/hanzo.ai/records
|
|
{ "name": "_acme-challenge", "type": "TXT", "value": "<token>", "ttl": 60 }
|
|
3. CoreDNS serves the TXT record immediately (no propagation delay)
|
|
4. Let's Encrypt validates the challenge
|
|
5. Certificate issued, challenge record deleted
|
|
6. Certificate stored in KMS (HIP-0027) and distributed to Hanzo Ingress (HIP-0068)</code></pre>
|
|
<p>Because the DNS server and the ACME client are co-located in the same cluster, challenge propagation is instant. There is no waiting for DNS TTLs to expire at upstream resolvers. This reduces wildcard certificate issuance from minutes to seconds.</p>
|
|
<h3>Zone Configuration</h3>
|
|
<p>Each organization manages its own zones. Zone ownership is enforced by the management API via IAM org membership.</p>
|
|
<p>| Zone | Organization | Purpose | |------|-------------|---------| | <code>hanzo.ai</code> | hanzo | Core platform services | | <code>hanzo.app</code> | hanzo | Application frontend | | <code>hanzo.id</code> | hanzo | Identity and access management | | <code>hanzo.network</code> | hanzo | Edge and CDN | | <code>lux.network</code> | lux | Blockchain services | | <code>lux.id</code> | lux | Lux identity | | <code>zoo.ngo</code> | zoo | Research network | | <code>zoo.id</code> | zoo | Zoo identity | | <code>pars.id</code> | pars | Pars identity |</p>
|
|
<p>Customer vanity domains (e.g., <code>api.customer.com</code>) are supported via CNAME delegation. The customer creates a CNAME record at their registrar pointing to <code><app>.edge.hanzo.network</code>, and Hanzo DNS handles the rest.</p>
|
|
<h2>Implementation</h2>
|
|
<h3>CoreDNS Plugin Chain</h3>
|
|
<p>The Hanzo DNS server is a custom CoreDNS build with four Hanzo-specific plugins compiled in:</p>
|
|
<pre><code class="lang-go">// plugin.cfg (CoreDNS build configuration)
|
|
// Standard plugins
|
|
log:log
|
|
errors:errors
|
|
cache:cache
|
|
kubernetes:kubernetes
|
|
acl:acl
|
|
health:health
|
|
ready:ready
|
|
prometheus:metrics
|
|
|
|
// Hanzo plugins
|
|
hanzo_records:github.com/hanzoai/dns/plugin/records
|
|
hanzo_geo:github.com/hanzoai/dns/plugin/geo
|
|
hanzo_acme:github.com/hanzoai/dns/plugin/acme
|
|
hanzo_sync:github.com/hanzoai/dns/plugin/sync</code></pre>
|
|
<p>| Plugin | Lines of Go | Purpose | |--------|-------------|---------| | <code>hanzo_records</code> | ~350 | Fetch records from management API, serve from memory | | <code>hanzo_geo</code> | ~250 | GeoIP-based response selection with health checks | | <code>hanzo_acme</code> | ~200 | ACME DNS-01 challenge record injection | | <code>hanzo_sync</code> | ~150 | Zone transfer (AXFR/IXFR) between primary and secondary |</p>
|
|
<h3>Management API Implementation</h3>
|
|
<p>The management API is a standalone Go binary that stores records in an embedded BoltDB database. BoltDB was chosen over SQL to maintain the zero-external-dependency constraint -- DNS cannot depend on the database it helps other services discover. The API and CoreDNS run as separate containers in the same pod, communicating over localhost on port 8053.</p>
|
|
<p>On each record mutation, the API: (1) validates the JWT against IAM JWKS, (2) checks org membership matches zone ownership, (3) validates the record format, (4) writes to BoltDB, (5) notifies the CoreDNS plugin to refresh its in-memory zone, and (6) triggers an IXFR to the secondary if configured.</p>
|
|
<h3>Deployment</h3>
|
|
<p>Each pod runs two containers: CoreDNS (port 53, 9153) and the management API (port 8053). Two replicas in <code>kube-system</code> namespace with anti-affinity ensure DNS survives a single node failure. Resource allocation: CoreDNS at 100m-500m CPU, 64Mi-256Mi memory; API at 50m-250m CPU, 32Mi-128Mi memory. DNSSEC keys are mounted from a Kubernetes Secret; zone data is on a PersistentVolumeClaim; the Corefile is a ConfigMap.</p>
|
|
<h3>Metrics</h3>
|
|
<p>Prometheus metrics are exported on port 9153 with namespace <code>hanzo_dns</code>:</p>
|
|
<p>| Metric | Type | Description | |--------|------|-------------| | <code>hanzo_dns_queries_total</code> | Counter | Total queries by zone, type, response code | | <code>hanzo_dns_query_duration_seconds</code> | Histogram | Query latency distribution | | <code>hanzo_dns_cache_hits_total</code> | Counter | Cache hit/miss by zone | | <code>hanzo_dns_geo_responses_total</code> | Counter | Geo-routed responses by region | | <code>hanzo_dns_dnssec_signatures_total</code> | Counter | DNSSEC signatures generated | | <code>hanzo_dns_api_requests_total</code> | Counter | Management API requests by method, status | | <code>hanzo_dns_zone_records_count</code> | Gauge | Record count per zone | | <code>hanzo_dns_edge_health</code> | Gauge | Edge endpoint health by region (0/1) |</p>
|
|
<h3>CLI Integration</h3>
|
|
<pre><code class="lang-bash"># Zone management
|
|
hanzo dns zones # List zones
|
|
hanzo dns zones create lux.network # Create a zone
|
|
|
|
# Record management
|
|
hanzo dns records hanzo.ai # List records for hanzo.ai
|
|
hanzo dns records hanzo.ai add # Interactive record creation
|
|
hanzo dns records hanzo.ai add \
|
|
--name api --type A --value 192.0.2.10 # Non-interactive
|
|
hanzo dns records hanzo.ai delete rec_abc123 # Delete a record
|
|
|
|
# Diagnostics
|
|
hanzo dns dig api.hanzo.ai # Query the authoritative server
|
|
hanzo dns verify hanzo.ai # Verify delegation and DNSSEC chain
|
|
hanzo dns export hanzo.ai # Export zone file (RFC 1035)</code></pre>
|
|
<h2>Security Considerations</h2>
|
|
<h3>DNSSEC Chain of Trust</h3>
|
|
<p>DNSSEC provides end-to-end integrity from the root zone to the individual record. The chain is: root (.) -> TLD (.ai) -> hanzo.ai -> api.hanzo.ai. Each link is verified cryptographically. A compromised resolver cannot forge responses because it does not possess the signing keys.</p>
|
|
<p>The DS (Delegation Signer) record for each zone must be registered with the parent TLD. This is a one-time manual step per zone (automated via registrar API where supported).</p>
|
|
<h3>Key Security</h3>
|
|
<ul><li><strong>KSK</strong> is stored in KMS (HIP-27) with restricted access. Only the DNS service's Universal Auth identity can read it.</li><li><strong>ZSK</strong> is generated locally and never leaves the CoreDNS pod. It rotates monthly with automated pre-publication rollover.</li><li><strong>API authentication</strong> uses IAM JWT tokens. Every API call is logged with the acting user, organization, and timestamp.</li><li><strong>Zone transfer</strong> between primary and secondary uses TSIG (Transaction Signature) with HMAC-SHA256 to prevent unauthorized zone copies.</li></ul>
|
|
<h3>Rate Limiting</h3>
|
|
<p>The DNS server enforces per-source rate limits to mitigate DNS amplification attacks:</p>
|
|
<ul><li><strong>UDP queries</strong>: 100 queries/second per source IP. Excess queries receive REFUSED.</li><li><strong>TCP queries</strong>: 20 connections/second per source IP.</li><li><strong>ANY queries</strong>: Dropped. ANY is the primary vector for DNS amplification and has no legitimate use in modern DNS.</li><li><strong>Management API</strong>: 100 requests/minute per authenticated user.</li></ul>
|
|
<h3>Access Control</h3>
|
|
<p>| Actor | DNS Query (53) | Management API (8053) | |-------|---------------|----------------------| | Internet | Public zones only | Via API Gateway + JWT | | Cluster pods | Public + internal zones | Direct + JWT | | Platform | Public + internal zones | Service account (auto-provisioning) | | CoreDNS secondary | Zone transfer (TSIG) | N/A |</p>
|
|
<h3>Preventing Zone Hijacking</h3>
|
|
<ul><li>Zone creation requires IAM admin role for the target organization.</li><li>Domain ownership is verified via DNS TXT record (<code>_hanzo-verify.<domain></code>) before the zone becomes active.</li><li>Managed records (created by Platform) cannot be deleted via the API without the <code>force: true</code> flag, which triggers an audit log alert.</li></ul>
|
|
<h2>References</h2>
|
|
<ol><li><a href="https://coredns.io/manual/toc/">CoreDNS Documentation</a></li><li><a href="https://coredns.io/2017/03/01/how-to-add-plugins-to-coredns/">CoreDNS Plugin Development</a></li><li><a href="https://tools.ietf.org/html/rfc1035">RFC 1035 - Domain Names: Implementation and Specification</a></li><li><a href="https://tools.ietf.org/html/rfc4033">RFC 4033 - DNS Security Introduction and Requirements (DNSSEC)</a></li><li><a href="https://tools.ietf.org/html/rfc4034">RFC 4034 - Resource Records for DNSSEC</a></li><li><a href="https://tools.ietf.org/html/rfc8555">RFC 8555 - ACME Protocol</a></li><li><a href="https://tools.ietf.org/html/rfc2845">RFC 2845 - TSIG for DNS</a></li><li><a href="https://www.maxmind.com/en/geoip2-databases">MaxMind GeoIP2</a></li><li><a href="./hip-0014-application-deployment-standard.md">HIP-14: Application Deployment Standard</a></li><li><a href="./hip-0026-identity-access-management-standard.md">HIP-26: Identity & Access Management Standard</a></li><li><a href="./hip-0027-secrets-management-standard.md">HIP-27: Secrets Management Standard</a></li><li>HIP-44: API Gateway Standard</li><li><a href="https://github.com/hanzoai/dns">Hanzo DNS Repository</a></li></ol>
|
|
<h2>Copyright</h2>
|
|
<p>Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</p>
|
|
<footer>
|
|
<div class="fmap">
|
|
<div><b>Build</b>
|
|
<a href="https://hanzo.app">hanzo.app</a> app builder
|
|
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
|
|
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
|
|
<div><b>Run</b>
|
|
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
|
|
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
|
|
<div><b>Account</b>
|
|
<a href="https://hanzo.id">hanzo.id</a> sign in
|
|
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
|
|
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
|
|
<div><b>Company</b>
|
|
<a href="https://hanzo.ai">hanzo.ai</a> canonical
|
|
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
|
|
</div>
|
|
<div class="fend"><a href="/hip-0049.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |