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; TLDexample.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 TLSDoHDNS 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
タブを全て閉じる