Skip to Content
Linux クックブック、第 2 版
book

Linux クックブック、第 2 版

by Carla Schroder
May 2025
Intermediate to advanced
544 pages
7h 23m
Japanese
O'Reilly Media, Inc.
Content preview from Linux クックブック、第 2 版

第16章 Dnsmasqとhostsファイルでローカルネームサービスを管理する Dnsmasqとhostsファイルでローカルネームサービスを管理する

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

Dnsmasqは Domain Name System (DNS) と Dynamic Host Discovery Protocol (DHCP) の両方の LAN ネームサービスを提供する優れたサーバである。DnsmasqはBOOTP、PXE、TFTPも提供し、ネットワークブートとネットワークサーバからのオペレーティングシステムのインストールを行う。 DnsmasqはIPv4とIPv6をサポートし、ローカルDNSキャッシュを提供し、スタブリゾルバとして動作する。

この章では、Dnsmasqと/etc/hostsファイルを併用したローカルDNSとDHCPのセットアップを取り上げる。/etc/hostsは 、DNSを設定する非常に古い方法で、静的ファイルでホスト名をIPアドレスにマッピングする。小規模なネットワークでは/etc/hostsだけで十分である。

DnsmasqはLANネームサービス用に設計されている。DNSサーバの主流であるBINDは重量級で、学習曲線がかなり険しい。

Dnsmasqと/etc/hostsは相性がいい。Dnsmasqは/etc/hostsのエントリをDNSに読み取る。

DnsmasqのDHCPサーバは自動的にDNSと統合される。 DnsmasqがDHCPクライアントのDNSエントリを作成するために必要なのは、DHCPクライアントがホスト名をDHCPサーバに送信するように設定することだけである。

DNSサーバーには、再帰的リゾルバー、ルートネームサーバー、トップレベルドメイン(TLD)ネームサーバー、権威ネームサーバーの4種類がある。

再帰的リゾルバーDNSリクエストに応答する。Dnsmasqやsystemd-resolvedのようなスタブリゾルバは、 キャッシュから応答できないリクエストを上流のリゾルバに転送する。Webサイトにアクセスすると、再帰的リゾルバは他の3種類のDNSサーバに クエリを発行してサイトのDNS情報を発見する。再帰的リゾルバは、この情報をより迅速に利用できるようにキャッシュする。ISPのネームサーバーや、OpenDNSCloudflareGoogle Public DNSなどのサービスは、すべて再帰的リゾルバである。

、13種類のルートネームサーバが地球上に分散しており、現在数百のルートネームサーバが存在する。ルートサーバーは再帰的リゾルバからのクエリを受け入れ、次にルートサーバーはトップレベルドメインに従って適切なTLDサーバーにリクエストをディレクトリする:.com、.net、.org、.me、.biz、.int、.biz、.gov、.eduなど。Internet Corporation for Assigned Names and Numbers-ICANN-は、これらすべてのサーバとドメインを管理している。

権威ネームサーバドメインのソースレコードであり、ドメインの所有者によって管理される。Dnsmasqを権威ネームサーバとして使用することもできるが、BINDを使用することをお勧めする。詳しくはman 8 dnsmasqのAuthoritative Configurationセクションを参照のこと .

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
Bash クックブック第2版

Bash クックブック第2版

Carl Albing, JP Vossen
行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

Stephen Wendel, 武山 政直, 相島 雅樹, 反中 望, 松村 草也

Publisher Resources

ISBN: 9798341650091