markdown
DNSの基本md c9d71c2
lecture/information/networks/dns-basics.lecture.n.md
Download PDF

DNSの基本きほん

date2026-07-14document_iddoc_327abe96f28ebbbcb7077cd25650efa5descriptionDNSの階層的な名前空間、資源レコード、名前解決、キャッシュ、通信方式を説明する。prerequisitesネットワークの基本 / TCPとIPの基本type講義statusactiverelateddata/lecture/information/networks/computer-networks-portal.lecture.n.md / data/lecture/information/networks/tcp-and-ip-basics.lecture.n.md / data/lecture/information/networks/http-basics.lecture.n.md
informationnetworksundergraduatelecture
data/lecture/information/networks/tcp-and-ip-basics.lecture.n.md

1導入どうにゅう

この講義こうぎでは、DNSDomain Name Systemが階層的かいそうてきかつ分散的ぶんさんてきにドメイン名めいの情報じょうほうを管理かんりする仕組しくみを説明せつめいする。名前解決なまえかいけつに関与かんよするサーバの役割やくわり、資源しげんレコード、キャッシュ、DNSが利用りようするトランスポートを順じゅんに確認かくにんする。

2階層的かいそうてきで分散的ぶんさんてきな名前空間なまえくうかん

ドメイン名めいDomain nameは、www.example.comのようにラベルを階層的かいそうてきに連結れんけつした名前なまえである。DNSの名前空間なまえくうかんでは、最上位さいじょういにルートがあり、その下したにcomなどのトップレベルドメインTop-level domain; TLD、example.comなどの下位かいドメインが配置はいちされる。

DNSは単一たんいつのサーバがすべての情報じょうほうを管理かんりする方式ほうしきではない。名前空間なまえくうかんの管理かんりを複数ふくすうの組織そしきとサーバへ委任いにんする分散型ぶんさんがたのシステムである。

3資源しげんレコード

DNSが保持ほじする情報じょうほうの単位たんいを資源しげんレコードResource recordという。代表的だいひょうてきな種類しゅるいは次つぎのとおりである。

種類しゅるい役割やくわり
Aドメイン名めいにIPv4アドレスを対応たいおうづける
AAAAドメイン名めいにIPv6アドレスを対応たいおうづける
CNAME別名べつめいを正規名せいきめいに対応たいおうづける
MXメールを受信じゅしんするサーバを指定していする
NSドメインの権威けんいDNSサーバを指定していする
TXT文字列もじれつの情報じょうほうを保持ほじする

したがって、DNSはドメイン名めいをIPアドレスへ変換へんかんするだけの仕組しくみではない。アドレスの取得しゅとくは、A recordまたはAAAA recordを照会しょうかいする代表的だいひょうてきな利用例りようれいである。

4リゾルバと権威けんいDNSサーバ

アプリケーションからDNS照会しょうかいを受うけ付つける機能きのうをスタブリゾルバStub resolverという。スタブリゾルバは通常つうじょう、再帰さいきリゾルバRecursive resolverへ照会しょうかいを依頼いらいする。再帰さいきリゾルバは、必要ひつような回答かいとうや委任情報いにんじょうほうがキャッシュにない場合ばあい、ルートDNSサーバからTLDのDNSサーバ、権威けんいDNSサーバAuthoritative name serverへ委任いにんを概念的がいねんてきにたどる。キャッシュされた委任情報いにんじょうほうがあれば、途中とちゅうの段階だんかいから照会しょうかいを開始かいしできる。

権威けんいDNSサーバは、委任いにんされた範囲はんいの名前なまえについて正式せいしきな資源しげんレコードを提供ていきょうする。再帰さいきリゾルバは、複数ふくすうのDNSサーバへの反復的はんぷくてきな照会しょうかいをクライアントに代かわって実行じっこうし、最終的さいしゅうてきな回答かいとうをクライアントへ返かえす。

5名前解決なまえかいけつとキャッシュ

www.example.comのアドレスを取得しゅとくする処理しょりは、概念的がいねんてきには次つぎの順序じゅんじょとなる。

  1. アプリケーションがスタブリゾルバへ照会しょうかいを依頼いらいする。
  2. スタブリゾルバが再帰さいきリゾルバへ照会しょうかいする。
  3. 再帰さいきリゾルバは、有効ゆうこうなキャッシュがあれば、その回答かいとうを返かえす。
  4. 必要ひつようなキャッシュがなければ、ルート、TLD、権威けんいDNSサーバの委任関係いにんかんけいをたどって参照先さんしょうさきと回答かいとうを取得しゅとくする。キャッシュされた委任情報いにんじょうほうがあれば、その途中とちゅうから開始かいしする。
  5. 再帰さいきリゾルバが回答かいとうをキャッシュし、スタブリゾルバへ返かえす。

資源しげんレコードにはTTLTime to Liveが付随ふずいする。キャッシュはTTLの有効期間内ゆうこうきかんないに回答かいとうを再利用さいりようし、照会遅延しょうかいちえんとDNSサーバの負荷ふかを低減ていげんする。その一方いっぽうで、レコードを変更へんこうしても、既存きそんのキャッシュが失効しっこうするまでは古ふるい情報じょうほうが使用しようされる可能性かのうせいがある。

6DNSのトランスポート

DNSの従来型じゅうらいがたの通信つうしんは、通常つうじょう、ポート53のUDPまたはTCPを使用しようする。一般的いっぱんてきな照会しょうかいではUDPが広ひろく使用しようされるが、UDP応答おうとうが切きり詰つめられた場合ばあいや、TCPが必要ひつような処理しょりではTCPを使用しようする。DoTDNS over TLSやDoHDNS over HTTPSは、DNS通信つうしんを暗号化あんごうかする別べつの方式ほうしきである。

DNS照会しょうかいそのものもIPネットワーク上じょうで実行じっこうされる。したがって、DNSを「TCP/IPより前まえに実行じっこうされる独立どくりつした処理しょり」と解釈かいしゃくしてはならない。

7名前解決なまえかいけつからWeb通信つうしんへ

URLのホストがドメイン名めいで表記ひょうきされている場合ばあい、クライアントはDNSによって一ひとつまたは複数ふくすうのIPアドレスを取得しゅとくし、通信先つうしんさきを選択せんたくする。その後ご、HTTP/1.1またはHTTP/2ではTCP接続せつぞくを確立かくりつする。HTTP/3はTCPではなく、UDP上じょうのQUICQUICを使用しようする。IPアドレスを直接ちょくせつ指定していした場合ばあいには、ドメイン名めいの名前解決なまえかいけつを必要ひつようとしないこともある。

8要点ようてん

  • DNSは階層的かいそうてきかつ分散的ぶんさんてきな名前空間なまえくうかんと資源しげんレコードの照会しょうかいシステムである。
  • 再帰さいきリゾルバは、キャッシュまたは権威けんいDNSサーバなどへの照会しょうかいから回答かいとうを取得しゅとくする。
  • キャッシュはTTLの期間きかんに回答かいとうを再利用さいりようし、遅延ちえんと負荷ふかを低減ていげんする。
  • DNS通信つうしんはIPネットワーク上じょうでUDP、TCP、または暗号化あんごうかされた方式ほうしきを使用しようする。

9次つぎに進すすむ講義こうぎ

data/lecture/information/networks/http-basics.lecture.n.md

DNS Fundamentals

data/lecture/information/networks/tcp-and-ip-basics.lecture.n.md

1Introduction

This lecture explains how the DNSDomain Name System manages domain-name information through a hierarchical, distributed system. It examines the roles of the servers involved in resolution, resource records, caching, and the transports used by DNS.

2A Hierarchical, Distributed Namespace

A domain nameDomain name, such as www.example.com, consists of hierarchically joined labels. The DNS namespace has a root at its top, followed by top-level domainsTop-level domain; TLD such as com and lower domains such as example.com.

DNS does not store all information on one server. It is a distributed system that delegates management of parts of the namespace to multiple organizations and servers.

3Resource Records

The units of information stored by DNS are called resource recordsResource record. Common record types include the following.

TypeRole
AAssociates a domain name with an IPv4 address
AAAAAssociates a domain name with an IPv6 address
CNAMEAssociates an alias with a canonical name
MXSpecifies a server that receives email
NSSpecifies an authoritative name server for a domain
TXTStores textual information

DNS therefore does more than convert domain names to IP addresses. Address retrieval through an A record or AAAA record is one important use.

4Resolvers and Authoritative Name Servers

A stub resolverStub resolver accepts DNS queries from applications. It normally sends a query to a recursive resolverRecursive resolver. If the recursive resolver lacks the required answer and delegation information in its cache, it conceptually follows delegations from root name servers through TLD name servers to an authoritative name serverAuthoritative name server. Cached delegation information can allow the process to begin at an intermediate stage.

An authoritative name server supplies the official resource records for a delegated portion of the namespace. A recursive resolver performs iterative queries to multiple name servers on behalf of a client and returns the final answer to the client.

5Resolution and Caching

Retrieving an address for www.example.com conceptually proceeds as follows.

  1. An application requests a query through its stub resolver.
  2. The stub resolver queries a recursive resolver.
  3. If the recursive resolver has a valid cached answer, it returns that answer.
  4. If the required information is not cached, it follows delegations involving root, TLD, and authoritative name servers to obtain referrals and an answer. Cached delegation information can allow it to begin partway through this process.
  5. The recursive resolver caches the answer and returns it to the stub resolver.

A resource record has a TTLTime to Live. A cache reuses an answer while its TTL remains valid, reducing query latency and load on DNS servers. Conversely, after a record changes, old information can remain in use until existing cached entries expire.

6DNS Transport

Traditional DNS communication normally uses UDP or TCP on port 53. UDP is widely used for ordinary queries, while TCP is used when a UDP response is truncated or an operation requires TCP. DoTDNS over TLS and DoHDNS over HTTPS are alternative mechanisms that encrypt DNS communication.

DNS queries themselves operate over IP networks. DNS must therefore not be interpreted as a separate process that occurs before TCP/IP.

7From Resolution to Web Communication

When a URL host is written as a domain name, a client uses DNS to obtain one or more IP addresses and selects a destination. It then establishes a TCP connection for HTTP/1.1 or HTTP/2. HTTP/3 instead uses QUICQUIC over UDP. When an IP address is specified directly, domain-name resolution may not be required.

8Key Points

  • DNS is a hierarchical, distributed namespace and resource-record query system.
  • A recursive resolver obtains an answer from its cache or through queries involving authoritative name servers.
  • Caches reuse answers during their TTLs to reduce latency and load.
  • DNS communication operates over IP using UDP, TCP, or encrypted alternatives.

9Next Lecture

data/lecture/information/networks/http-basics.lecture.n.md
raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる