How DNS Works and the file named “hosts” (500words)

上級600 words
2025-10-24

When you type a web address like www.example.com into your browser, your computer needs to find the correct server to connect to. However, the internet does not understand names like example.com directly. Instead, it uses numbers called IP addresses, such as 93.184.216.34. These addresses work like phone numbers for computers. The system that helps translate human-readable names into IP addresses is called the Domain Name System, or DNS.

ブラウザに www.example.com のようなウェブアドレスを入力すると、コンピュータは接続先のサーバーを見つける必要があります。しかし、インターネットは example.com のような名前を直接理解しません。代わりに、93.184.216.34 のような IP アドレスと呼ばれる番号を使用します。これらのアドレスは、コンピュータにとって電話番号のような役割を果たします。人間が読める名前を IP アドレスに変換するシステムは、ドメインネームシステム(DNS)と呼ばれます。

DNS works like a huge, distributed phone book for the internet. When you enter a domain name, your computer first asks a DNS resolver for help. The resolver is often provided by your Internet Service Provider (ISP) or by a public DNS service like Google’s (8.8.8.8). The resolver does not always know the answer right away, so it starts asking other DNS servers.

DNS は、インターネット上の巨大な分散型電話帳のような役割を果たします。ドメイン名を入力すると、コンピュータはまず DNS リゾルバに問い合わせます。リゾルバは、多くの場合、インターネットサービスプロバイダ(ISP)や Google のパブリック DNS サービス(8.8.8.8)によって提供されます。リゾルバは必ずしもすぐに答えを得られるとは限らないため、他の DNS サーバーに問い合わせを開始します。

The first stop is the root DNS server. There are only a few hundred of these servers around the world, and they know where to find information about top-level domains (TLDs) such as .com, .org, or .net. The root server points the resolver to the TLD server that is responsible for the domain’s extension. For example, if the user is trying to reach example.com, the root server sends the resolver to the .com TLD server.

最初の経由地はルート DNS サーバーです。これらのサーバーは世界中に数百台しかなく、.com、.org、.net などのトップレベルドメイン (TLD) に関する情報がどこにあるかを知っています。ルートサーバーは、リゾルバーをドメインの拡張子を管理する TLD サーバーに誘導します。例えば、ユーザーが example.com にアクセスしようとしている場合、ルートサーバーはリゾルバーを .com TLD サーバーに誘導します。

Next, the TLD server tells the resolver which authoritative DNS server holds the records for example.com. The authoritative server is the final source of truth—it contains the actual IP address of the website. Once the resolver gets this information, it sends the IP address back to your computer, and the browser can finally connect to the website’s server.

次に、TLD サーバーはリゾルバーに、example.com のレコードを保持している権威 DNS サーバーを指示します。権威サーバーは最終的な情報源であり、ウェブサイトの実際の IP アドレスを保持しています。リゾルバーはこの情報を取得すると、IP アドレスをユーザーのコンピューターに送り返し、ブラウザは最終的にウェブサイトのサーバーに接続できるようになります。

To make this process faster, DNS uses caching. This means that once a DNS record is found, it is stored temporarily on your computer or in the resolver’s memory. If you visit the same website again soon, your computer can use the cached record instead of repeating the entire lookup.

このプロセスを高速化するために、DNS はキャッシュを使用します。つまり、DNS レコードが見つかると、それはユーザーのコンピューターまたはリゾルバーのメモリに一時的に保存されます。同じウェブサイトにすぐに再度アクセスした場合、コンピューターはキャッシュされたレコードを使用することで、検索全体を繰り返す必要がなくなります。

Without DNS, we would have to remember long strings of numbers for every website we want to visit. Thanks to DNS, we can simply use easy-to-remember names. It is one of the most important systems that keeps the internet user-friendly and efficient.

DNSがなければ、アクセスしたいウェブサイトごとに長い数字列を覚えていなければなりませんでした。DNSのおかげで、覚えやすい名前を使うだけで済みます。これは、インターネットをユーザーフレンドリーで効率的なものにしている最も重要なシステムの一つです。

Before DNS became common, computers used a simple text file called the hosts file to map domain names to IP addresses. Even today, every computer still has this file. The hosts file acts like a small, local DNS system. When you try to open a website, your computer first checks the hosts file to see if there is a matching entry. If it finds one, it uses the IP address written there and skips the DNS lookup process. This can be useful for testing new websites, blocking unwanted domains, or redirecting addresses for local development. However, because it must be updated manually, the hosts file is not practical for managing the entire internet. DNS replaced it with a faster and more scalable system, but the hosts file still plays an important role for local or special network configurations.

DNSが普及する前は、コンピューターはドメイン名とIPアドレスをマッピングするために、hostsファイルと呼ばれるシンプルなテキストファイルを使用していました。今日でも、すべてのコンピューターにこのファイルが搭載されています。hostsファイルは、小規模なローカルDNSシステムのように機能します。ウェブサイトを開こうとすると、コンピューターはまずhostsファイルをチェックし、一致するエントリがあるかどうかを確認します。一致するエントリが見つかった場合、そこに記述されているIPアドレスを使用し、DNSルックアッププロセスをスキップします。これは、新しいウェブサイトのテスト、不要なドメインのブロック、ローカル開発のためのアドレスのリダイレクトなどに便利です。しかし、hostsファイルは手動で更新する必要があるため、インターネット全体の管理には実用的ではありません。DNSによってhostsファイルはより高速でスケーラブルなシステムに置き換えられましたが、hostsファイルは依然としてローカルまたは特別なネットワーク構成において重要な役割を果たしています。