Product SiteDocumentation Site

10.7. ドメインネームサーバ (DNS)

The Domain Name Service (DNS) is a fundamental component of the Internet: it maps host names to IP addresses (and vice-versa), which allows the use of www.debian.org instead of 130.89.148.77 or 2001:67c:2564:a119::77.
DNS レコードはゾーン分けされています。それぞれのゾーンはドメイン (またはサブドメイン) か IP アドレス範囲に対応付けられます (なぜなら、ゾーンは通常連続した IP アドレス範囲を割り当てられるからです)。プライマリサーバはあるゾーンに含まれる内容の情報を提供する権威的なサーバです。さらに、セカンダリサーバは通常プライマリサーバとは別のマシン上でホストされ、定期的にプライマリゾーンのコピーをとるサーバです。
Each zone can contain records of various kinds (Resource Records), these are some of the most common:

10.7.1. DNS software

The reference name server, Bind, was developed and is maintained by ISC (the Internet Software Consortium). It is provided in Debian by the bind9 package. Version 9 brings two major changes compared to previous versions. First, the DNS server can now run under an unprivileged user, so that a security vulnerability in the server does not grant root privileges to the attacker (as was seen repeatedly with versions 8.x).
2 番目は Bind が DNS レコードの署名 (すなわち DNS レコードの認証) に DNSSEC 標準をサポートするようになった変更です。これにより、中間者攻撃で DNS レコードが偽装された場合に、偽装された DNS レコードを遮断することが可能になりました。

10.7.2. Configuring bind

バージョンによらず bind の設定ファイルは同じ構造をしています。
Falcot の管理者は falcot.com ドメインに関連する情報を保存するためにプライマリ falcot.com ゾーンを作成し、ローカルネットワーク内の IP アドレスとの逆引き対応を付けるために 168.192.in-addr.arpa ゾーンを作成しました。
以下に Falcot のファイルから抜粋した設定を載せます。これは DNS サーバの設定の足掛かりになります。

例 10.12 /etc/bind/named.conf.local の抜粋

zone "falcot.com" {
        type master;
        file "/etc/bind/db.falcot.com";
        allow-query { any; };
        allow-transfer {
                195.20.105.149/32 ; // ns0.xname.org
                193.23.158.13/32 ; // ns1.xname.org
        };
};

zone "internal.falcot.com" {
        type master;
        file "/etc/bind/db.internal.falcot.com";
        allow-query { 192.168.0.0/16; };
};

zone "168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.192.168";
        allow-query { 192.168.0.0/16; };
};

例 10.13 /etc/bind/db.falcot.com の抜粋

; falcot.com ゾーン
; admin.falcot.com. でゾーン連絡先アドレスに admin@falcot.com を指定したことになります
$TTL    604800
@       IN      SOA     falcot.com. admin.falcot.com. (
                        20040121        ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
; @ はゾーン名 (ここでは "falcot.com") または
; $ORIGIN 指示文が使われていた場合 $ORIGIN を意味します
;
@       IN      NS      ns
@       IN      NS      ns0.xname.org.

internal IN      NS      192.168.0.2

@       IN      A       212.94.201.10
@       IN      MX      5 mail
@       IN      MX      10 mail2

ns      IN      A       212.94.201.10
mail    IN      A       212.94.201.10
mail2   IN      A       212.94.201.11
www     IN      A       212.94.201.11

dns     IN      CNAME   ns

例 10.14 /etc/bind/db.192.168 の抜粋

; 192.168.0.0/16 用の逆引きゾーン
; admin.falcot.com. でゾーン連絡先アドレスに admin@falcot.com を指定したことになります
$TTL    604800
@       IN      SOA     ns.internal.falcot.com. admin.falcot.com. (
                        20040121        ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

        IN      NS      ns.internal.falcot.com.

; 192.168.0.1 を arrakis に対応付けます
1.0     IN      PTR     arrakis.internal.falcot.com.
; 192.168.0.2 を neptune に対応付けます
2.0     IN      PTR     neptune.internal.falcot.com.

; 192.168.3.1 を pau に対応付けます
1.3     IN      PTR     pau.internal.falcot.com.