lost and found ( for me ? )

unbound : change configuration on the fly with unbound-control

unbound 1.4.5

unbound-control set_option で on the fly でコンフィグの変更ができるみたい。
ただし、すべてのオプションを on the fly で変更できるわけではない。
どれが可能 or not は書いてないなー。

unbound-control
set_option opt: val
             Set the option to the given value without a reload.   The  cache
             is  therefore  not  flushed.  The option must end with a ':' and
             whitespace must be between the option and the value.  Some  val-
             ues  may  not have an effect if set this way, the new values are
             not written to the config file, not all options are supported.

      get_option opt
             Get the value of the option.  Give the  option  name  without  a
             trailing  ':'.  The value is printed.  If the value is "", noth-
             ing is printed and the connection closes.  On error 'error  ...'
             is  printed  (it  gives  a syntax error on unknown option).  For
             some options a list of values, one on  each  line,  is  printed.
             Not all options are supported.

現在の設定を取得
root@hat1:~# unbound-control get_option do-tcp
no

設定変更
root@hat1:~# unbound-control set_option do-tcp: yes
ok

反映された
root@hat1:~# unbound-control get_option do-tcp
yes

キャッシュサイズもかえられるのかなー。
root@hat1:~# unbound-control get_option msg-cache-size
4194304

できたっぽい。
root@hat1:~# unbound-control set_option msg-cache-size: 200m
ok


root@hat1:~# unbound-control get_option msg-cache-size
209715200

名前解決に使われたネームサーバもチェックできるんだ。
root@hat1:~# unbound-control lookup www.google.co.jp
The following name servers are used for lookup of www.google.co.jp.
;rrset 86233 4 0 2 0
google.co.jp. 86233 IN NS ns2.google.com.
google.co.jp. 86233 IN NS ns4.google.com.
google.co.jp. 86233 IN NS ns3.google.com.
google.co.jp. 86233 IN NS ns1.google.com.
;rrset 84681 1 0 8 0
ns1.google.com. 343881 IN A 216.239.32.10
;rrset 84681 1 0 8 0
ns3.google.com. 343881 IN A 216.239.36.10
;rrset 84681 1 0 8 0
ns4.google.com. 343881 IN A 216.239.38.10
;rrset 84681 1 0 8 0
ns2.google.com. 343881 IN A 216.239.34.10
Delegation with 4 names, of which 4 can be examined to query further addresses.
It provides 4 IP addresses.
216.239.34.10    rtt 260 msec, 0 lost. EDNS 0 probed.
216.239.38.10    rtt 261 msec, 0 lost. EDNS 0 probed.
216.239.36.10    rtt 189 msec, 0 lost. EDNS 0 probed.
216.239.32.10    rtt 206 msec, 0 lost. EDNS 0 probed.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.