質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
DNS

DNSとは、Domain Name Systemのことで、インターネットなどのTCP/IPネットワーク上でドメイン名やホスト名と、IPアドレスとの対応づけを管理するシステムです。DNSのデータベースは、IPアドレスの4つの数字を通知するDNSサーバーで構築されており、IPアドレスをドメイン名から引き出す機能やドメイン名に関するメールサーバ情報を取り扱っています。

Q&A

解決済

1回答

9227閲覧

DNSキャッシュサーバ(unbound)が動作しない

wasshoi

総合スコア7

DNS

DNSとは、Domain Name Systemのことで、インターネットなどのTCP/IPネットワーク上でドメイン名やホスト名と、IPアドレスとの対応づけを管理するシステムです。DNSのデータベースは、IPアドレスの4つの数字を通知するDNSサーバーで構築されており、IPアドレスをドメイン名から引き出す機能やドメイン名に関するメールサーバ情報を取り扱っています。

0グッド

0クリップ

投稿2018/06/03 10:43

編集2018/06/03 10:44

unboundを用いてDNSキャッシュサーバを構築したが、名前解決ができませんでした。

DNSサーバの設定で名前解決できることは下記コマンドから確認できています。
host ns1.example.jp xxx.xxx.xxx.10
dig @xxx.xxx.xxx.10 ns1.example.jp A
ping ns1.example.jp

ただ、名前解決を行うサーバをDNSキャッシュサーバに変更すると名前解決が行われません。
DNSキャッシュサーバや、他のクライアントPCからも試したが、結果は同じでした。
host ns1.example.jp xxx.xxx.xxx.11
dig @xxx.xxx.xxx.11 ns1.example.jp A
ping ns1.example.jp

DNSサーバで内部NW向けのゾーンを作成し、内部の名前解決と、外部の名前解決を行うために
内部のクライアントが設定するDNSサーバとして、DNSキャッシュサーバを登録し、
DNSキャッシュサーバが自動で両方の名前解決を行うことを目標にしています。

そのためのステップとして、DNSキャッシュサーバから内部ゾーンの名前解決をしたかったのですが、上手く動きませんでした。
DNSもDNSキャッシュもdnsサービスは許可しています。
どうして、期待通りに動作しないのでしょうか。ご教授お願いできますでしょうか。

◆環境
・win10PCにて、仮想環境上にサーバを構築
virtual box 5.2.8 r121009 (Qt5.6.2)

・仮想環境上のNW構成
DNSサーバ: xxx.xxx.xxx.10/24 (ns1.example.jp)
DNSキャッシュサーバ: xxx.xxx.xxx.11/24 (cns.example.jp)

※サーバは全てCentOS7.4です。

◆unboundの設定
■/etc/unbound/unbound.conf(デフォルトのまま変更していない。設定は別途ファイルにて行っている。)
server:
verbosity: 1
statistics-interval: 0
statistics-cumulative: no
extended-statistics: yes
num-threads: 4
interface-automatic: no
so-reuseport: yes
ip-transparent: yes
chroot: ""
username: "unbound"
directory: "/etc/unbound"
log-time-ascii: yes
pidfile: "/var/run/unbound/unbound.pid"
harden-glue: yes
harden-dnssec-stripped: yes
harden-below-nxdomain: yes
harden-referral-path: yes
unwanted-reply-threshold: 10000000
prefetch: yes
prefetch-key: yes
rrset-roundrobin: yes
minimal-responses: yes
module-config: "ipsecmod validator iterator"
trust-anchor-signaling: yes
trusted-keys-file: /etc/unbound/keys.d/.key
auto-trust-anchor-file: "/var/lib/unbound/root.key"
val-clean-additional: yes
val-permissive-mode: no
val-log-level: 1
include: /etc/unbound/local.d/
.conf
ipsecmod-enabled: no
ipsecmod-hook: "/usr/libexec/ipsec/_unbound-hook"
python:
remote-control:
control-enable: yes
server-key-file: "/etc/unbound/unbound_server.key"
server-cert-file: "/etc/unbound/unbound_server.pem"
control-key-file: "/etc/unbound/unbound_control.key"
control-cert-file: "/etc/unbound/unbound_control.pem"
include: /etc/unbound/conf.d/*.conf

■/etc/unbound/local.d/interface.conf
interface: 127.0.0.1
interface: xxx.xxx.xxx.11

■/etc/unbound/local.d/client.conf
access-control: 127.0.0.1/8 allow
access-control: xxx.xxx.0.0/16 allow

■/etc/unbound/conf.d/example.jp.conf
stub-zone:
name: example.jp
stub-prime: no
stub-addr: xxx.xxx.xxx.10

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

DNS サーバー側のゾーン(example.jp)で、DNSSEC が有効でない場合、/etc/unbound/unbound.conf で domain-insecure: "example.jp" が必要です。

###(2018/06/04 09:54) 追記
unbound のデバッグログ、DNS サーバー側のクエリーログまたはパケットキャプチャーで、
「DNSクライアント → unbound → DNSサーバー → unbound → DNSクライアント」
の経路のどこまでできているか確認するといいと思います。

投稿2018/06/03 15:05

編集2018/06/04 00:54
TaichiYanagiya

総合スコア12141

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

wasshoi

2018/06/04 10:36 編集

ご回答ありがとうございます。 早速検証してみましたが、単純にunboundの設定を変更しただけでは動きませんでした。 DNS側のDNSSECの設定も確認してみたいと思います。 また、/var/log/messageに出力されているログを確認してみました。 (その際に、verbosity: 1 ⇒ verbosity: 3に変更) 名前解決を問い合わせているようなメッセージがありましたが、 DNS(xxx.xxx.xxx.10)へ問い合わせているメッセージはありませんでした。 下記がそのメッセージです。(一部抜粋) info: validator operate: query example.jp. A IN debug: iterator[module 2] operate: extstate:module_state_initial event:module_event_pass info: resolving example.jp. A IN info: processQueryTargets: example.jp. A IN info: sending query: example.jp. A IN debug: sending to target: <.> 192.168.zzz.zzz#53 info: error sending query to auth server 192.168.zzz.zzz port 53 info: processQueryTargets: example.jp. A IN ※192.168.zzz.zzzは自宅のルータのIPアドレスで、こちらが外部の名前解決を行うDNSです。 現状、そっちへアクセスできるNICは落としています。 やはりクライアントからunboundへのリクエストが出来ていないようですね。 もう少し調べてみたいと思います。
TaichiYanagiya

2018/06/04 12:39

> debug: sending to target: <.> 192.168.zzz.zzz#53 stub-zone が認識されておらず、(質問文にはありませんが) forward-zone で処理されているように思います。 unbound の再起動はしていますよね?
wasshoi

2018/06/04 16:16

失礼しました。 これが原因かと思いforward-zoneの設定を追加していました。 forward-zoneの設定をコメントアウトして、再度確認してみました。 また、unboundの再起動は行っています。コマンドは下記です。 unbound-checkconf ⇒で設定が問題ないことを確認 unbound-control reload  ⇒で設定を再読み込み systemctl restart unbound ⇒念のため再起動 ■以下log [実行コマンド: host example.jp DNSキャッシュサーバのIP] Jun 5 01:04:09 cDNS unbound: [1114:1] info: validator operate: query example.jp. A IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: resolving example.jp. A IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: priming . IN NS Jun 5 01:04:09 cDNS unbound: [1114:1] info: iterator operate: query . NS IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: processQueryTargets: . NS IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: sending query: . NS IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: error sending query to auth server 192.5.5.241 port 53 Jun 5 01:04:09 cDNS unbound: [1114:1] info: processQueryTargets: . NS IN ⇒これ以降は、下記のようなログが、IPアドレスxxx.xxx.xxx.xxxの部分だけ変わって 500行近くが続いています。 Jun 5 01:04:09 cDNS unbound: [1114:1] info: sending query: . NS IN Jun 5 01:04:09 cDNS unbound: [1114:1] info: error sending query to auth server xxx.xxx.xxx.xxx port 53 Jun 5 01:04:09 cDNS unbound: [1114:1] info: processQueryTargets: . NS IN その中に、DNSやDNSキャッシュサーバのIPは含まれておらず、各アドレスの値は何の値か不明なものでした。
TaichiYanagiya

2018/06/05 01:19

stub-zone 設定が読み込まれると、起動時に「info: DelegationPoint<example.jp.>: 0 names (0 missing), 1 addrs (0 result, 1 avail) parentNS」のようなログが出力されます。 /etc/unbound/unbound.conf に直接設定しても変化ないでしょうか。
wasshoi

2018/06/05 08:02

/etc/unbound/unbound.confへsuub-zoneに直接設定したところ 正常にキャッシュDNSから名前解決できるようになりました! といいますか、どうやらstub-zoneの設定を記載していたファイル名が誤っておりまして、初歩的なミスでお恥ずかしいです。 設定ファイルが×の方の名前となっておりました。 /etc/unbound/conf.d/example.jp × /etc/unbound/conf.d/example.jp.conf 〇 整理しましすと、今回設定できていない所は2箇所でした。 1. stub-zone設定 ⇒/etc/unbound/conf.d/ に置くconfファイルの名前ミス 2. domain-insecure設定 ⇒DNSでDNSSECの設定をしていない為(ZSK鍵もKSK鍵も未作成で、公開鍵のゾーンへの登録もゾーンに対する署名も行っていない。)、 "example.jp"の設定をする必要がある。 おかげさまで解決することが出来ました! ベストアンサーに登録させて頂きます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問