RHEL 7.7 から、搭載される BIND のバージョンが 9.9.4 系から 9.11.4 系に Rebase されたようだ。
RHEL 7.7 Release Notes (English)
RHEL 7.7 Release Notes (日本語)
RHEL 7.7 に特化してデフォルト Config を細かく調べていく必要が出てきたので、そのメモを雑に残す。
なお、ISC BIND の純粋な差分は、過去の自分が雑にメモしていたようだ。
BIND のデフォルト値と各バージョンの差分 (9.9.9-P3, 9.10.4-P3, 9.11.0)
https://www.sgv417.jp/~makopi/blog/archives/882
■RHEL 7.7 における新機能の追加
基本的に RHEL は「Red Hat Enterprise Linux Life Cycle」に従ってメンテナンスがされている。
今回 RHEL 7 は、まだ Full Support のフェーズだったため、機能追加が実施されたようだ。
なお RHEL 7.7 リリースに合わせて、IP_PMTUDISC_OMIT がデフォルトで使用可能となったようだ。 [RHSA-2019:2118]
結果、DNS フラグメント攻撃に対しても、緩衝策が実装されることとなった。
参考:DNSフラグメント攻撃に対する権威サーバ側の緩和策について
■RHEL 5 以降のこれまで搭載された bind バージョン
新機能の追加が、Full Support フェーズ内だけであることを確認してみた。
確かに Full Support フェーズ内だけで、Rebase が発生している。
RHEL Version | BIND Package Version | BIND Package Base Version |
---|---|---|
RHEL 5.0 | bind-9.3.3-7.el5 | 9.3.3 |
RHEL 5.1 | bind-9.3.3-10.el5 | 9.3.3 |
RHEL 5.2 | bind-9.3.4-6.P1.el5 | 9.3.4-P1 |
RHEL 5.3 | bind-9.3.4-10.P1.el5 | 9.3.4-P1 |
RHEL 5.4 | bind-9.3.6-4.P1.el5 | 9.3.6-P1 |
RHEL 5.5 | bind-9.3.6-4.P1.el5_4.2 | 9.3.6-P1 |
RHEL 5.6 | bind-9.3.6-16.P1.el5 bind97-9.7.0-6.P2.el5 |
9.3.6-P1 9.7.0-P2 |
RHEL 5.7 | bind-9.3.6-16.P1.el5 bind97-9.7.0-6.P2.el5_6.3 |
9.3.6-P1 9.7.0-P2 |
RHEL 5.8 | bind-9.3.6-20.P1.el5 bind97-9.7.0-6.P2.el5_7.4 |
9.3.6-P1 9.7.0-P2 |
RHEL 5.9 | bind-9.3.6-20.P1.el5_8.5 bind97-9.7.0-17.P2.el5 |
9.3.6-P1 9.7.0-P2 |
RHEL 5.10 | bind-9.3.6-20.P1.el5_8.6 bind97-9.7.0-17.P2.el5_9.2 |
9.3.6-P1 9.7.0-P2 |
RHEL 5.11 | bind-9.3.6-20.P1.el5_8.6 bind97-9.7.0-21.P2.el5 |
9.3.6-P1 9.7.0-P2 |
RHEL 6.0 | bind-9.7.0-5.P2.el6 | 9.7.0-P2 |
RHEL 6.1 | bind-9.7.3-2.el6 | 9.7.3 |
RHEL 6.2 | bind-9.7.3-8.P3.el6 | 9.7.3-P3 |
RHEL 6.3 | bind-9.8.2-0.10.rc1.el6 | 9.8.2rc1 |
RHEL 6.4 | bind-9.8.2-0.17.rc1.el6 | 9.8.2rc1 |
RHEL 6.5 | bind-9.8.2-0.17.rc1.el6_4.6 | 9.8.2rc1 |
RHEL 6.6 | bind-9.8.2-0.30.rc1.el6 | 9.8.2rc1 |
RHEL 6.7 | bind-9.8.2-0.37.rc1.el6 | 9.8.2rc1 |
RHEL 6.8 | bind-9.8.2-0.47.rc1.el6 | 9.8.2rc1 |
RHEL 6.9 | bind-9.8.2-0.62.rc1.el6 | 9.8.2rc1 |
RHEL 6.10 | bind-9.8.2-0.68.rc1.el6 | 9.8.2rc1 |
RHEL 7.0 | bind-9.9.4-14.el7 | 9.9.4 |
RHEL 7.1 | bind-9.9.4-18.el7 | 9.9.4 |
RHEL 7.2 | bind-9.9.4-29.el7 | 9.9.4 |
RHEL 7.3 | bind-9.9.4-37.el7 | 9.9.4 |
RHEL 7.4 | bind-9.9.4-50.el7 | 9.9.4 |
RHEL 7.5 | bind-9.9.4-61.el7 | 9.9.4 |
RHEL 7.6 | bind-9.9.4-72.el7 | 9.9.4 |
RHEL 7.7 | bind-9.11.4-9.P2.el7 | 9.11.4-P2 |
RHEL 8.0 | bind-9.11.4-16.P2.el8 | 9.11.4-P2 |
RHEL 8.1 (Beta) | bind-9.11.4-22.P2.el8 | 9.11.4-P2 |
■RHEL 7 に搭載される BIND パッケージの Config デフォルト値
基本的には、[BIND-SRC]/bin/named/config.c を見ればわかるっぽい。
Red Hat によるパッチが存在するため、Source RPM をダウンロード及び展開し、rpmbuild -bp を実施しないと、最終的な Config は取り出せない。
●Pre Build を実施するまで
・パッケージの展開
$ rpm -ivh bind-9.9.4-72.el7.src.rpm
・依存関係の解決するために、必要なパッケージのインストール
# yum-builddep ~[USERNAME]/rpmbuild/SPECS/bind.spec
・Pre Build の実施
$ rpmbuild -bp ~/rpmbuild/SPECS/bind.spec
-bp を引数とすることで、SPEC ファイルの「%prep」までビルドを実施する。
(unpack sources and apply patches)
上記手順を実施することで、ホームディレクトリの「rpmbuild」ディレクトリ内に次のものが生成される。
- SOURCES:パッケージのソースコードとパッチ
- BUILD:パッチが適用されたソースコード
■config.c から該当部を抜き出したもの
■bind-9.9.4-72.el7 と bind-9.11.4-9.P2.el7 の差分
$ diff bind-9.9.4-72.el7_DefaultConfig.txt bind-9.11.4-9.P2.el7_DefaultConffig.txt 3a4 > answer-cookie true;\n\ 4a6 > bindkeys-file \"" NS_SYSCONFDIR "/bind.keys\";\n\ 5a8,12 > #if defined(HAVE_OPENSSL_AES) || defined(HAVE_OPENSSL_EVP_AES) > " cookie-algorithm aes;\n" > #else > " cookie-algorithm sha256;\n" > #endif 8,10c15 < datasize default;\n\ < files unlimited;\n\ < stacksize default;\n" --- > datasize default;\n" 12,15c17,18 < "# session-keyfile \"" NS_LOCALSTATEDIR "/run/named/session.key\";\n\ < session-keyname local-ddns;\n\ < session-keyalg hmac-sha256;\n\ < deallocate-on-exit true;\n\ --- > "\ > # deallocate-on-exit <obsolete>;\n\ 18,19c21,27 < fake-iquery no;\n\ < has-old-clients false;\n\ --- > edns-udp-size 4096;\n\ > # fake-iquery <obsolete>;\n" > #ifndef WIN32 > " files unlimited;\n" > #endif > "\ > # has-old-clients <obsolete>;\n\ 21c29 < host-statistics no;\n\ --- > # host-statistics <obsolete>;\n\ 22a31 > # keep-response-order {none;};\n\ 24a34 > # lock-file \"" NS_LOCALSTATEDIR "/run/named/named.lock\";\n\ 26a37 > max-udp-size 4096;\n\ 28c39 < multiple-cnames no;\n\ --- > # multiple-cnames <obsolete>;\n\ 29a41,42 > nocookie-udp-size 4096;\n\ > notify-rate 20;\n\ 33d45 < bindkeys-file \"" NS_SYSCONFDIR "/bind.keys\";\n\ 35,37c47 < recursing-file \"named.recursing\";\n\ < secroots-file \"named.secroots\";\n\ < " --- > prefetch 2 9;\n" 39,41c49 < "\ < random-device \"" PATH_RANDOMDEV "\";\n\ < " --- > " random-device \"" PATH_RANDOMDEV "\";\n" 43c51 < "\ --- > " recursing-file \"named.recursing\";\n\ 44a53,54 > request-nsid false;\n\ > reserved-sockets 512;\n\ 47c57,59 < serial-queries 20;\n\ --- > secroots-file \"named.secroots\";\n\ > send-cookie false;\n\ > # serial-queries <obsolete>;\n\ 49a62,68 > session-keyalg hmac-sha256;\n\ > # session-keyfile \"" NS_LOCALSTATEDIR "/run/named/session.key\";\n\ > session-keyname local-ddns;\n" > #ifndef WIN32 > " stacksize default;\n" > #endif > " startup-notify-rate 20;\n\ 51,52c70,71 < statistics-interval 60;\n\ < tcp-clients 100;\n\ --- > # statistics-interval <obsolete>;\n\ > tcp-clients 150;\n\ 55d73 < # tkey-gssapi-credential <none>\n\ 57c75,76 < transfers-per-ns 2;\n\ --- > # tkey-gssapi-credential <none>\n\ > transfer-message-size 20480;\n\ 60,69c79,83 < treat-cr-as-space true;\n\ < use-id-pool true;\n\ < use-ixfr true;\n\ < edns-udp-size 4096;\n\ < max-udp-size 4096;\n\ < request-nsid false;\n\ < reserved-sockets 512;\n\ < \n\ < /* DLV */\n\ < dnssec-lookaside . trust-anchor dlv.isc.org;\n\ --- > transfers-per-ns 2;\n\ > # treat-cr-as-space <obsolete>;\n\ > trust-anchor-telemetry yes;\n\ > # use-id-pool <obsolete>;\n\ > # use-ixfr <obsolete>;\n\ 71a86,90 > acache-cleaning-interval 60;\n\ > acache-enable no;\n\ > additional-from-auth true;\n\ > additional-from-cache true;\n\ > allow-new-zones no;\n\ 73d91 < allow-update-forwarding {none;};\n\ 77a96 > allow-update-forwarding {none;};\n\ 79,80d97 < # sortlist <none>\n\ < # topology <none>\n\ 82,103d98 < minimal-responses false;\n\ < recursion true;\n\ < provide-ixfr true;\n\ < request-ixfr true;\n\ < fetch-glue no;\n\ < rfc2308-type1 no;\n\ < additional-from-auth true;\n\ < additional-from-cache true;\n\ < query-source address *;\n\ < query-source-v6 address *;\n\ < notify-source *;\n\ < notify-source-v6 *;\n\ < cleaning-interval 0; /* now meaningless */\n\ < min-roots 2;\n\ < lame-ttl 600;\n\ < max-ncache-ttl 10800; /* 3 hours */\n\ < max-cache-ttl 604800; /* 1 week */\n\ < transfer-format many-answers;\n\ < max-cache-size 0;\n\ < check-names master fail;\n\ < check-names slave warn;\n\ < check-names response ignore;\n\ 105a101,103 > check-names master fail;\n\ > check-names response ignore;\n\ > check-names slave warn;\n\ 107,112c105 < acache-enable no;\n\ < acache-cleaning-interval 60;\n\ < max-acache-size 16M;\n\ < dnssec-enable yes;\n\ < dnssec-validation yes; \n\ < dnssec-accept-expired no;\n\ --- > cleaning-interval 0; /* now meaningless */\n\ 113a107,132 > dnssec-accept-expired no;\n\ > dnssec-enable yes;\n\ > dnssec-validation yes; \n" > #ifdef HAVE_DNSTAP > " dnstap-identity hostname;\n" > #endif > "\ > # fetch-glue <obsolete>;\n\ > fetch-quota-params 100 0.1 0.3 0.7;\n\ > fetches-per-server 0;\n\ > fetches-per-zone 0;\n" > #ifdef ALLOW_FILTER_AAAA > " filter-aaaa-on-v4 no;\n\ > filter-aaaa-on-v6 no;\n\ > filter-aaaa { any; };\n" > #endif > #ifdef HAVE_GEOIP > " geoip-use-ecs yes;\n" > #endif > " lame-ttl 600;\n" > #ifdef HAVE_LMDB > " lmdb-mapsize 32M;\n" > #endif > " max-acache-size 16M;\n\ > max-cache-size 90%;\n\ > max-cache-ttl 604800; /* 1 week */\n\ 114a134 > max-ncache-ttl 10800; /* 3 hours */\n\ 116,117c136,142 < max-recursion-queries 50;\n\ < zero-no-soa-ttl-cache no;\n\ --- > max-recursion-queries 75;\n\ > message-compression yes;\n\ > # min-roots <obsolete>;\n\ > minimal-any false;\n\ > minimal-responses false;\n\ > notify-source *;\n\ > notify-source-v6 *;\n\ 119,127c144,160 < allow-new-zones no;\n\ < " < #ifdef ALLOW_FILTER_AAAA_ON_V4 < " filter-aaaa-on-v4 no;\n\ < filter-aaaa { any; };\n\ < " < #endif < < " /* zone */\n\ --- > provide-ixfr true;\n\ > query-source address *;\n\ > query-source-v6 address *;\n\ > recursion true;\n\ > request-expire true;\n\ > request-ixfr true;\n\ > require-server-cookie no;\n\ > # rfc2308-type1 <obsolete>;\n\ > root-key-sentinel yes;\n\ > servfail-ttl 1;\n\ > # sortlist <none>\n\ > # topology <none>\n\ > transfer-format many-answers;\n\ > v6-bias 50;\n\ > zero-no-soa-ttl-cache no;\n\ > \n\ > /* zone */\n\ 131d163 < notify yes;\n\ 133,134c165,171 < notify-delay 5;\n\ < notify-to-soa no;\n\ --- > alt-transfer-source *;\n\ > alt-transfer-source-v6 *;\n\ > check-integrity yes;\n\ > check-mx-cname warn;\n\ > check-sibling yes;\n\ > check-srv-cname warn;\n\ > check-wildcard yes;\n\ 135a173,176 > dnssec-dnskey-kskonly no;\n\ > dnssec-loadkeys-interval 60;\n\ > dnssec-secure-to-insecure no;\n\ > dnssec-update-mode maintain;\n\ 138c179,181 < maintain-ixfr-base no;\n\ --- > inline-signing no;\n\ > ixfr-from-differences false;\n\ > # maintain-ixfr-base <obsolete>;\n\ 140,145c183,186 < transfer-source *;\n\ < transfer-source-v6 *;\n\ < alt-transfer-source *;\n\ < alt-transfer-source-v6 *;\n\ < max-transfer-time-in 120;\n\ < max-transfer-time-out 120;\n\ --- > max-journal-size unlimited;\n\ > max-records 0;\n\ > max-refresh-time 2419200; /* 4 weeks */\n\ > max-retry-time 1209600; /* 2 weeks */\n\ 148,150c189,190 < max-retry-time 1209600; /* 2 weeks */\n\ < min-retry-time 500;\n\ < max-refresh-time 2419200; /* 4 weeks */\n\ --- > max-transfer-time-in 120;\n\ > max-transfer-time-out 120;\n\ 151a192 > min-retry-time 500;\n\ 153,154c194,197 < dnssec-secure-to-insecure no;\n\ < sig-validity-interval 30; /* days */\n\ --- > notify yes;\n\ > notify-delay 5;\n\ > notify-to-soa no;\n\ > serial-update-method increment;\n\ 158,172c201,203 < inline-signing no;\n\ < zone-statistics terse;\n\ < max-journal-size unlimited;\n\ < ixfr-from-differences false;\n\ < check-wildcard yes;\n\ < check-sibling yes;\n\ < check-integrity yes;\n\ < check-mx-cname warn;\n\ < check-srv-cname warn;\n\ < zero-no-soa-ttl yes;\n\ < update-check-ksk yes;\n\ < serial-update-method increment;\n\ < dnssec-update-mode maintain;\n\ < dnssec-dnskey-kskonly no;\n\ < dnssec-loadkeys-interval 60;\n\ --- > sig-validity-interval 30; /* days */\n\ > transfer-source *;\n\ > transfer-source-v6 *;\n\ 173a205,207 > update-check-ksk yes;\n\ > zero-no-soa-ttl yes;\n\ > zone-statistics terse;\n\ 184,186c218,219 < " < #ifdef USE_RRL < " # Prevent use of this zone in DNS amplified reflection DoS attacks\n\ --- > \n\ > # Prevent use of this zone in DNS amplified reflection DoS attacks\n\ 192,194c225,226 < " < #endif /* USE_RRL */ < " zone \"version.bind\" chaos {\n\ --- > \n\ > zone \"version.bind\" chaos {\n\ 216,217c248,249 < # Default trusted key(s) for builtin DLV support\n\ < # (used if \"dnssec-lookaside auto;\" is set and\n\ --- > # Default trusted key(s), used if \n\ > # \"dnssec-validation auto;\" is set and\n\
いや多すぎだろ・w・;
よくよく見ると、おなじ定義が位置ずれていたりしているようだ。
BIND9 のソースコードリファクタリングの件が原因だろうか・・・?
というわけで、並びを手動で変更およびコメントアウトされた部分を削除し、再度差分を取得してみた。
■(再度)bind-9.9.4-72.el7 と bind-9.11.4-9.P2.el7 の差分
$ diff bind-9.9.4-72.el7_DefaultConfig_mod.txt bind-9.11.4-9.P2.el7_DefaultConffig_mod.txt 3a4 > answer-cookie true;\n\ 4a6,11 > bindkeys-file \"" NS_SYSCONFDIR "/bind.keys\";\n\ > #if defined(HAVE_OPENSSL_AES) || defined(HAVE_OPENSSL_EVP_AES) > " cookie-algorithm aes;\n" > #else > " cookie-algorithm sha256;\n" > #endif 7,9c14 < datasize default;\n\ < files unlimited;\n\ < stacksize default;\n" --- > datasize default;\n" 12,13d16 < bindkeys-file \"" NS_SYSCONFDIR "/bind.keys\";\n\ < deallocate-on-exit true;\n\ 15,16c18,22 < fake-iquery no;\n\ < has-old-clients false;\n\ --- > edns-udp-size 4096;\n\ > #ifndef WIN32 > " files unlimited;\n" > #endif > "\ 18d23 < host-statistics no;\n\ 23a29 > max-udp-size 4096;\n\ 25c31,32 < multiple-cnames no;\n\ --- > nocookie-udp-size 4096;\n\ > notify-rate 20;\n\ 29c36 < " --- > prefetch 2 9;\n" 31,33c38 < "\ < random-device \"" PATH_RANDOMDEV "\";\n\ < " --- > " random-device \"" PATH_RANDOMDEV "\";\n" 36,37d40 < edns-udp-size 4096;\n\ < max-udp-size 4096;\n\ 45c48 < serial-queries 20;\n\ --- > send-cookie false;\n\ 49c52,57 < session-keyname local-ddns;\n\ --- > session-keyname local-ddns;\n" > #ifndef WIN32 > " stacksize default;\n" > #endif > "\ > startup-notify-rate 20;\n\ 51,52c59 < statistics-interval 60;\n\ < tcp-clients 100;\n\ --- > tcp-clients 150;\n\ 53a61 > transfer-message-size 20480;\n\ 57,62c65 < treat-cr-as-space true;\n\ < use-id-pool true;\n\ < use-ixfr true;\n\ < \n\ < /* DLV */\n\ < dnssec-lookaside . trust-anchor dlv.isc.org;\n\ --- > trust-anchor-telemetry yes;\n\ 87,89c90,110 < dnssec-validation yes; \n\ < fetch-glue no;\n\ < lame-ttl 600;\n\ --- > dnssec-validation yes; \n" > #ifdef HAVE_DNSTAP > " dnstap-identity hostname;\n" > #endif > "\ > fetch-quota-params 100 0.1 0.3 0.7;\n\ > fetches-per-server 0;\n\ > fetches-per-zone 0;\n" > #ifdef ALLOW_FILTER_AAAA > " filter-aaaa-on-v4 no;\n\ > filter-aaaa-on-v6 no;\n\ > filter-aaaa { any; };\n" > #endif > #ifdef HAVE_GEOIP > " geoip-use-ecs yes;\n" > #endif > " lame-ttl 600;\n" > #ifdef HAVE_LMDB > " lmdb-mapsize 32M;\n" > #endif > "\ 91c112 < max-cache-size 0;\n\ --- > max-cache-size 90%;\n\ 96,97c117,119 < max-recursion-queries 50;\n\ < min-roots 2;\n\ --- > max-recursion-queries 75;\n\ > message-compression yes;\n\ > minimal-any false;\n\ 105a128 > request-expire true;\n\ 107c130,132 < rfc2308-type1 no;\n\ --- > require-server-cookie no;\n\ > root-key-sentinel yes;\n\ > servfail-ttl 1;\n\ 108a134 > v6-bias 50;\n\ 110,117c136,137 < " < #ifdef ALLOW_FILTER_AAAA_ON_V4 < " filter-aaaa-on-v4 no;\n\ < filter-aaaa { any; };\n\ < " < #endif < < " /* zone */\n\ --- > \n\ > /* zone */\n\ 135d154 < maintain-ixfr-base no;\n\ 136a156 > max-records 0;\n\ 170,172c190,191 < " < #ifdef USE_RRL < " # Prevent use of this zone in DNS amplified reflection DoS attacks\n\ --- > \n\ > # Prevent use of this zone in DNS amplified reflection DoS attacks\n\ 178,180c197,198 < " < #endif /* USE_RRL */ < " zone \"version.bind\" chaos {\n\ --- > \n\ > zone \"version.bind\" chaos {\n\ 202,203c220,221 < # Default trusted key(s) for builtin DLV support\n\ < # (used if \"dnssec-lookaside auto;\" is set and\n\ --- > # Default trusted key(s), used if \n\ > # \"dnssec-validation auto;\" is set and\n\
結構絞れたけど、まだいくつか被った差分が出ている。
まあ被ってるのは大体前後に連結が増減して、引用符がついてしまってるのが原因だけど、そこまで合わせなくても大体がわかればいいかなと。
■所感
とりあえず、普通に OS のコンポーネントとして使うだけならば、あまり気にしなくてもよさそう。
ただし、この BIND パッケージを使って DNS サーバを立てる場合は、9.9 系列から 9.11 系列になることで動きが一部変わっている可能性が高い。
設定をよく見直す必要があるんじゃないかなと思った。
■BIND 9.9 から BIND 9.11 へ移行するにあたり、気にするべきポイント
過去に DNS Summer Day 2018 にて発表された資料があるので、そちらを読むべきと思う。
BIND 9.9から9.11へ移行のポイント(フルリゾルバ編)
https://dnsops.jp/event/20180627/BIND_9.9から9.11へ移行のポイント_フルリゾルバ編_v0.8.pdf
BIND 機能差分(9.9, 9.10, 9.11, 9.12)
https://dnsops.jp/event/20180627/ISC_BIND機能差分_v0.7.pdf
BIND 9.9から9.11へ移行のポイント(権威DNSサーバー編)
https://dnsops.jp/event/20180627/DNSSummerDay2018_BIND9.11変更点auth.pdf