DNSのレプリケーション設定と運用

検証環境

検証内容

レプリケーションについて

マスターDNSコンテンツサーバーの基本設定

/etc/rc.conf

以下の設定を追加する。

named_enable="YES"
named_chrootdir="/var/named"
altlog_proglist="named"

※altlog_proglist が既に設定済みの場合、「 named」を追加する。

/usr/local/etc/namedb/named.conf

   1 --- /usr/local/etc/namedb/named.conf.orig       2018-09-25 03:54:24.724317000 +0900
   2 +++ /usr/local/etc/namedb/named.conf    2018-10-09 00:36:27.390945000 +0900
   3 @@ -8,6 +8,22 @@
   4  // simple mistakes, you can break connectivity for affected parties,
   5  // or cause huge amounts of useless Internet traffic.
   6 
   7 +include "/usr/local/etc/namedb/rndc.key";
   8 +include "/usr/local/etc/namedb/ns1-rndc.key";
   9 +include "/usr/local/etc/namedb/ns2-rndc.key";
  10 +
  11 +controls {
  12 +       inet * port * allow {
  13 +               127.0.0.1; ::1;
  14 +               ns1.example.jpのIPアドレス;
  15 +               ns2.example.jpのIPアドレス;
  16 +       } keys {
  17 +               rndc-key;
  18 +               ns1-rndc-key;
  19 +               ns2-rndc-key;
  20 +       };
  21 +};
  22 +
  23  options {
  24         // All file and path names are relative to the chroot directory,
  25         // if any, and should be fully qualified.
  26 @@ -16,15 +32,22 @@
  27         dump-file       "/var/dump/named_dump.db";
  28         statistics-file "/var/stats/named.stats";
  29 
  30 +       recursion       no;
  31 +       allow-query       { any; };
  32 +       allow-recursion   { none; };
  33 +       allow-query-cache { none; };
  34 +
  35 +       allow-new-zones yes;
  36 +
  37  // If named is being used only as a local resolver, this is a safe default.
  38  // For named to be accessible to the network, comment this option, specify
  39  // the proper IP address, or delete this option.
  40 -       listen-on       { 127.0.0.1; };
  41 +       listen-on       { any; };
  42 
  43  // If you have IPv6 enabled on this system, uncomment this option for
  44  // use as a local resolver.  To give access to the network, specify
  45  // an IPv6 address, or the keyword "any".
  46 -//     listen-on-v6    { ::1; };
  47 +       listen-on-v6    { any; };
  48 
  49  // These zones are already covered by the empty zones listed below.
  50  // If you remove the related empty zones below, comment these lines out.

※カタログゾーン運用のための設定

参考文献