---
title: DNSインフラストラクチャ
url: https://doc.liz6.com/ja/networking/04-DNS/04-dns-infrastructure
locale: ja
area: networking
tags:
- networking
- DNS
date: 2026-06-30
modified: 2026-07-16
description: ルートサーバーは13台の物理マシンではなく、13のAnycastネットワークです。ルートからTLD、オーソライズドサーバーまで、各レイヤーは分散型です——このインフラストラクチャのアーキテクチャを理解して初めて、「DNSレコードを1つ変更する」という行為の裏側で何が起きているのかを知ることができます。
---

# DNSインフラストラクチャ

> ルートサーバーは13台の物理マシンではなく、13のAnycastネットワークです。ルートからTLD、オーソライズドサーバーまで、各レイヤーは分散型です——このインフラストラクチャのアーキテクチャを理解して初めて、「DNSレコードを1つ変更する」という行為の裏側で何が起きているのかを知ることができます。

## 概要

DNSは単なるプロトコルではありません。それは13のルートサーバー（Anycastを介して1000以上の物理インスタンスが展開）と数百のTLDレジストリで構成される、グローバルに分散されたデータベースです。CDNプロバイダ（Cloudflare/AWS/Azure）は、DNSをトラフィックの入口として活用しています。これは、クエリ元のIPに基づいて、最も近いデータセンターのアドレスを返す仕組みです。Split DNSは、企業や家庭のネットワークにおいて、内部と外部のビューを分離します。DNSインフラストラクチャを理解することは、インターネットの可用性と障害復旧の仕組みを理解する上で不可欠です。

## ルートサーバーシステム

13の論理的なルートサーバー識別子（a.root-servers.net ～ m.root-servers.net）があり、1000以上の物理インスタンスがAnycastを介して世界中に分散配置されています。

ルートゾーンサイズ: 約10KB（TLD委譲レコードのみ）。ルートサーバーは再帰クエリ（RD=0のみ）には応答せず、リファラル（参照先指示）のみを行います。

ルートヒントファイル（`/usr/share/dns/root.hints` または再帰リゾルバに内蔵）が、初期ブートストラップを提供します。

## Anycast

同じIPプレフィックスが、複数の物理的な場所で同時にアナウンスされます。BGPが自動的に、トラフィックを最も近い（ASパスの観点から）ノードにルーティングします。

<svg viewBox="0 0 720 340" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Anycastの原理: BGPによる最短パスのインスタンスへのクエリ">
  <defs>
    <marker id="mk-anycast" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker>
  </defs>
  <rect width="720" height="340" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Anycast: 同一IPを複数箇所でアナウンスし、BGPが最短パスのインスタンスへルーティング</text>

  <rect x="40" y="55" width="300" height="70" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="190" y="80" text-anchor="middle" font-size="13" font-weight="700" fill="#3730a3">AnycastインスタンスA ・ 東京</text>
  <text x="190" y="100" text-anchor="middle" font-size="11" fill="#4f46e5">ASパス: AS1 → dns-root</text>

  <rect x="380" y="55" width="300" height="70" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="530" y="80" text-anchor="middle" font-size="13" font-weight="700" fill="#3730a3">AnycastインスタンスB ・ フランクフルト</text>
  <text x="530" y="100" text-anchor="middle" font-size="11" fill="#4f46e5">ASパス: AS2 → AS3 → dns-root</text>

  <line x1="190" y1="195" x2="190" y2="130" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-anycast)"/>
  <text x="200" y="165" font-size="11" fill="#475569">BGPがより短いパスを認識</text>

  <line x1="530" y1="195" x2="530" y2="130" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-anycast)"/>
  <text x="540" y="165" font-size="11" fill="#475569">BGPがより短いパスを認識</text>

  <rect x="40" y="200" width="300" height="56" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="190" y="223" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">アジアのクライアント</text>
  <text x="190" y="242" text-anchor="middle" font-size="11" fill="#0f766e">→ 東京インスタンスへクエリ</text>

  <rect x="380" y="200" width="300" height="56" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="530" y="223" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">ヨーロッパのクライアント</text>
  <text x="530" y="242" text-anchor="middle" font-size="11" fill="#0f766e">→ フランクフルトインスタンスへクエリ</text>

  <rect x="60" y="278" width="600" height="50" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="76" y="299" font-size="12.5" fill="#115e59">同じクライアントからの2つのクエリが必ずしも同じインスタンスに到達するわけではありません（同一/24が一貫してアナウンスされない限り）——</text>
  <text x="76" y="317" font-size="12.5" fill="#115e59">しかし、DNSにとっては理想的です。各クエリは独立して処理されます。</text>
</svg>

Anycastの動作原理: 同じクライアントからの2つのクエリが必ずしも同じインスタンスに到達するわけではありません（同一/24が一貫してアナウンスされない限り）。これはDNSにとって理想的な動作です。各クエリは独立して処理されます。

## CDN DNS

<svg viewBox="0 0 720 290" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="CDN DNS: クエリが最も近いエッジノードへルーティングされるパス">
  <defs>
    <marker id="mk-cdn" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker>
  </defs>
  <rect width="720" height="290" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">CDN DNS = トラフィックの入口: クエリが最も近いエッジノードへルーティングされる</text>

  <rect x="14" y="52" width="128" height="54" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="78" y="74" text-anchor="middle" font-size="11" font-weight="700" fill="#3730a3">クライアントクエリ</text>
  <text x="78" y="92" text-anchor="middle" font-size="10" fill="#4f46e5">www.example.com</text>

  <rect x="152" y="52" width="128" height="54" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="216" y="74" text-anchor="middle" font-size="11" font-weight="700" fill="#3730a3">オーソライズドDNS</text>
  <text x="216" y="92" text-anchor="middle" font-size="10" fill="#4f46e5">CDNによってホストされる</text>

  <rect x="290" y="52" width="150" height="54" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="365" y="74" text-anchor="middle" font-size="11" font-weight="700" fill="#3730a3">クエリ元IPを確認</text>
  <text x="365" y="92" text-anchor="middle" font-size="10" fill="#4f46e5">最も近いエッジPoPを選択</text>

  <rect x="450" y="52" width="108" height="54" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="504" y="83" text-anchor="middle" font-size="11" font-weight="700" fill="#3730a3">エッジIPを返す</text>

  <rect x="568" y="52" width="138" height="54" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="637" y="74" text-anchor="middle" font-size="11" font-weight="700" fill="#3730a3">クライアント → エッジ</text>
  <text x="637" y="92" text-anchor="middle" font-size="10" fill="#4f46e5">→ CDNエッジ → バックエンド</text>

  <line x1="142" y1="79" x2="152" y2="79" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-cdn)"/>
  <line x1="280" y1="79" x2="290" y2="79" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-cdn)"/>
  <line x1="440" y1="79" x2="450" y2="79" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-cdn)"/>
  <line x1="558" y1="79" x2="568" y2="79" stroke="#475569" stroke-width="1.6" marker-end="url(#mk-cdn)"/>

  <text x="20" y="132" font-size="13" font-weight="700" fill="#1f2933">主要技術</text>

  <rect x="20" y="145" width="215" height="72" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="34" y="168" font-size="12" font-weight="700" fill="#115e59">GeoDNS</text>
  <text x="34" y="186" font-size="10.5" fill="#0f766e">ソースIP → 地理データベース</text>
  <text x="34" y="203" font-size="10.5" fill="#0f766e">→ 最寄りのリージョン → IPを返す</text>

  <rect x="257" y="145" width="215" height="72" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="271" y="168" font-size="12" font-weight="700" fill="#115e59">レイテンシベース</text>
  <text x="271" y="186" font-size="10.5" fill="#0f766e">エッジとソースIP間のリアルタイムレイテンシ測定</text>
  <text x="271" y="203" font-size="10.5" fill="#0f766e">→ 最低レイテンシを選択</text>

  <rect x="494" y="145" width="215" height="72" rx="6" fill="#ffedd5" stroke="#f97316"/>
  <text x="508" y="168" font-size="12" font-weight="700" fill="#9a3412">ECS（クライアントサブネット）</text>
  <text x="508" y="186" font-size="10.5" fill="#c2410c">リゾルバがサブネット /24(v4)/56(v6) を渡す</text>
  <text x="508" y="203" font-size="10.5" fill="#c2410c">→ より正確なエッジ選択だが、情報が漏洩する</text>

  <rect x="20" y="230" width="680" height="50" rx="8" fill="#ffedd5" stroke="#f97316"/>
  <text x="36" y="251" font-size="12.5" fill="#9a3412">ECSによりCDNはより正確にエッジを選択できますが、クライアントのサブネット情報をオーソライズドDNSに渡すことになります。</text>
  <text x="36" y="269" font-size="12.5" fill="#9a3412">——精度とプライバシーのトレードオフです。</text>
</svg>

## Split DNS

内部ネットワークは異なるDNSビューを使用します:

```
内部（家庭/企業ネットワーク）:
  grafana.liz6.com → 192.168.31.8（内部IP、パブリックネットワークを経由しない）

パブリックネットワーク:
  grafana.liz6.com → VPS IP（ratholeトンネル経由）

実装:
  - BIND: views { match-clients { internal_net; }; ... }
  - Unbound: access-control-view
  - dnsmasq: address=/grafana.liz6.com/192.168.31.8
```

## DNSベースのロードバランシング

```
加重ラウンドロビン:
  www.example.com A 1.1.1.1
  www.example.com A 2.2.2.2
  → リゾルバがランダムに選択（通常はクライアントが最初のIPを選ぶが、リゾルバによって動作が異なる）

レイテンシベース（Route 53）:
  latency alias + ヘルスチェック → 自動的に最低レイテンシの正常なエンドポイントを選択

地理的プロキシミティ（Traffic Manager）:
  地理的ルーティング + エンドポイントモニタリング
```

## 参考

- **RSSAC**: root-servers.org
- **CDN**: Cloudflare Anycast, AWS Route 53, Azure Traffic Manager

*キーワード: ルートサーバー, anycast, CDN DNS, GeoDNS, split DNS, ECS, DNSベースのロードバランシング*
