0
0

More than 5 years have passed since last update.

QNAME-MINIMISATIONに対する権威サーバの応答の比較(改訂版)

Last updated at Posted at 2015-12-22

はじめに

QNAME-MINIMISATIONの実装が出てきたようなので、投稿します。

  • PowerDNSのPeter van Dijk(@Habbie)さんから、PowerDNSではレコードを登録後にpdnssec recitfy-zoneコマンドを実行するようにとアドバイスを頂きましたので、rectify-zone実行後の結果を追記しました。
  • 本投稿は、以前にGitHub上に作成した資料に追記したものです。そのため設定ファイル・digの結果のリンク先はGitHub上のファイルを指しています。
  • 筆者は、Windows ServerおよびMicrosoft DNSの超初心者です(運用したことがありません)。
  • 投稿時のURLが間違っていた(下書きを指していた)ので修正しました。

環境

クライアント

  • OS: Ubuntu Mate 15.04
  • DNSクライアント: DiG 9.10.3

サーバ

  • OS: CentOS 6.7 on VirtualBox

    • 権威DNSサーバ
      • Bind: 9.10.2-P3
      • NSD: 4.1.3
      • PowerDNS Authoritative Server 3.4.7(MySQL Backend)
      • knotDNS 1.6.4
  • OS: Microsoft Windows 2008R2

  • OS: Microsoft Windows 2012R2

調査内容

各DNSサーバ上にゾーンexample.comを設定します。その設定ファイルは、以下のとおりです。

$TTL 300
@    IN SOA ns1.example.com. hostmaster.example.com. (
                                    0       ; serial
                                    1D      ; refresh
                                    1H  ; retry
                                    1W  ; expire
                                    3H )    ; minimum
       IN NS  ns1
www     IN A   <www.example.comのIPアドレス>
ns1     IN A   <DNSサーバのIPアドレス>
yyy.zzz IN A   <yyy.zzz.example.comのIPアドレス>

このゾーンに対してQNAME-Minimisationなresolverが、empty non-terminalであるyyy.zzz.example.comのAを引けるかどうかを調べます。ここでは、draft-ietf-dnsop-qname-minimisation-07
のAppendix Aに記載されているAn algorithm to find the zone cutを、digコマンドにて実行します。

前提条件

既にキャッシュには、example.comのNSレコードとそのAレコードが存在するものとします。

example.com.   IN  NS  ns1.example.com.
example.com.   IN  A   <DNSサーバのIPアドレス>

結果

()付きの数字は、draft-ietf-dnsop-qname-minimisation-07のAppendix Aのものです。

Bind / NSD / knotDNS / Windoes 2012R2

  1. クエリを受信

QNAME = yyy.zzz.example.com.
TYPE = A

  1. QNAMEはキャッシュに存在しない(0)

  2. PARENT = example.com. (1)

  3. CHILD = example.com. = PARENT (2)

  4. CHILD != QNAME (3)

  5. CHILDにラベルを1つ追加 (4)

    CHILD = zzz.example.com.

  6. CHILDのNS RRsetはキャッシュにない(5)

  7. ns1.example.com.にCHILD = zzz.example.comのNSをクエリ (6)

    $ dig @ zzz.example.com. NS +norec

  1. 応答はNOERROR/NODATA answerであるため、応答キャッシュに保存し、(3)へ (6d)

  2. CHILD != QNAME (3)

  3. CHILDにラベルを1つ追加 (4)

    CHILD = yyy.zzz.example.com.

  4. CHILDのNS RRsetはキャッシュにない (5)

  5. ns1.example.com.にCHILD = yyy.zzz.example.comのNSをクエリ (6)

    $ dig @ yyy.zzz.example.com. NS +norec

  1. 応答はNOERROR/NODATA answerであるため、応答キャッシュに保存し、(3)へ (6d)

  2. CHILD == QNAME のためCHILD(=QNAME)のAをクエリして終了 (3)

    $ dig @ yyy.zzz.example.com. A +norec

PowerDNS ( pdnssec rectify-zoneを実行しない )/ Windows 2008R2

  1. クエリを受信

QNAME = yyy.zzz.example.com.
TYPE = A

  1. QNAMEはキャッシュに存在しない(0)

  2. PARENT = example.com. (1)

  3. CHILD = example.com. = PARENT (2)

  4. CHILD != QNAME (3)

  5. CHILDにラベルを1つ追加 (4)

    CHILD = zzz.example.com.

  6. CHILDのNS RRsetはキャッシュにない(5)

  7. ns1.example.com.にCHILD = zzz.example.comのNSをクエリ (6)

    $ dig @ zzz.example.com. NS +norec

  1. 応答はNXDOMAINであるため、応答キャッシュに保存し、終了 (6c)

PowerDNS ( pdnssec rectify-zoneを実行済み )

Backend(MySQL)にレコードを追加したあとに、pdnssec rectify-zoneコマンドを実行します。

$ pdnssec rectify-zone example.com
Non DNSSEC zone, only adding empty non-terminals

このコマンド実行後に、PowerDNSはNOERRORを返すようになります。詳細はPowerDNSのドキュメントRules for filling out fields in database backendsを参照してください。

  1. クエリを受信

QNAME = yyy.zzz.example.com.
TYPE = A

  1. QNAMEはキャッシュに存在しない(0)

  2. PARENT = example.com. (1)

  3. CHILD = example.com. = PARENT (2)

  4. CHILD != QNAME (3)

  5. CHILDにラベルを1つ追加 (4)

    CHILD = zzz.example.com.

  6. CHILDのNS RRsetはキャッシュにない(5)

  7. ns1.example.com.にCHILD = zzz.example.comのNSをクエリ (6)

    $ dig @ zzz.example.com. NS +norec

  1. 応答はNOERROR/NODATA answerであるため、応答キャッシュに保存し、(3)へ (6d)

  2. CHILD != QNAME (3)

  3. CHILDにラベルを1つ追加 (4)

    CHILD = yyy.zzz.example.com.

  4. CHILDのNS RRsetはキャッシュにない (5)

  5. ns1.example.com.にCHILD = yyy.zzz.example.comのNSをクエリ (6)

    $ dig @ yyy.zzz.example.com. NS +norec

  1. 応答はNOERROR/NODATA answerであるため、応答キャッシュに保存し、(3)へ (6d)

  2. CHILD == QNAME のためCHILD(=QNAME)のAをクエリして終了 (3)

    $ dig @ yyy.zzz.example.com. A +norec

pdnssec rectify-zone

PowerDNS(MySQL backend)にてpdnssec rectify-zoneを実行すると、recordsテーブルへzzz.example.comに対応する行が追加されます。

実行前

mysql> select * from records;
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+
| id | domain_id | name                | type | content                                                          | ttl  | prio | change_date | disabled | ordername | auth |
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+
|  1 |         1 | example.com         | SOA  | ns1.example.com hostmaster.example.com 0 86400 3600 604800 10800 |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  2 |         1 | example.com         | NS   | ns1.example.com.                                                 |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  3 |         1 | www.example.com     | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  4 |         1 | ns1.example.com     | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  5 |         1 | yyy.zzz.example.com | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+
5 rows in set (0.00 sec)

実行後

mysql> select * from records;
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+
| id | domain_id | name                | type | content                                                          | ttl  | prio | change_date | disabled | ordername | auth |
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+
|  1 |         1 | example.com         | SOA  | ns1.example.com hostmaster.example.com 0 86400 3600 604800 10800 |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  2 |         1 | example.com         | NS   | ns1.example.com.                                                 |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  3 |         1 | www.example.com     | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  4 |         1 | ns1.example.com     | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
|  5 |         1 | yyy.zzz.example.com | A    | 192.168.33.13                                                    |  300 | NULL |        NULL |        0 | NULL      |    1 |
| 11 |         1 | zzz.example.com     | NULL | NULL                                                             | NULL | NULL |        NULL |        0 | NULL      |    1 |
+----+-----------+---------------------+------+------------------------------------------------------------------+------+------+-------------+----------+-----------+------+

最後にid = 11, namae = "zzz.example.com"の行が追加されています。

まとめ

以下のDNSサーバは、QNAME-MINIMISATIONなキャッシュサーバが出た場合、名前解決ができません。

  • PowerDNS Authoritative Server(pdnssec rectify-zoneを実行していない)
  • Microsoft Windows 2008R2

PowerDNS Authoritative Serverはpdnssec rectify-zoneを実行することで、QNAME-MINIMISATIONに対応することができます。もし、PowerDNS設定用のGUIツールなどを利用している場合は、pdnssec rectify-zoneを実行しているか(または同等な機能を有しているか)を確認しましょう。

ちなみにPowerAdmin 2.1.7は、ダメでした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0