linux – BIND 9的nsupdate dyndns更新提供:“tsig verify failure(BADKEY)”

前端之家收集整理的这篇文章主要介绍了linux – BIND 9的nsupdate dyndns更新提供:“tsig verify failure(BADKEY)”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经浏览了DDNS上的这么多HOWTO页面试图解决这个问题……我很茫然.

WorkstationX = CentOS 6.2 x64
ServerX = Ubuntu 12.04 LTS x64

我不明白为什么它不起作用……我实际上是出于想法.我已经多次重新生成并重新配置了所有内容.

我已经确定了:

>在两台主机上运行NTPD,我已验证NTP正在运行
> TZ对两个节点都是正确的(硬件是UTC)
>我遵循了这些指南:

> linux.yyz.us/nsupdate/
> agiletesting.blogspot.com.au/2012/03/dynamic-dns-updates-with-nsupdate-and.html
> www.cheshirekow.com/wordpress/?p=457
> www.erianna.com/nsupdate-dynamic-dns-updates-with-bind9
> consultancy.edvoncken.net/index.PHP/HOWTO_Manage_Dynamic_DNS_with_nsupdate
> blog.philippklaus.de/2013/01/updating-dns-entries-with-nsupdate-or-alternative-implementations-your-own-ddns/

他们中的一些有不同的生成密钥的方法,但其余的是相同的……当我尝试nsupdate时 – 即使在运行dnssec-keygen的服务器上(以及绑定的地方),我得到相同的日志项:

  1. Aug 14 11:20:38 vps named[31247]: 14-Aug-2013 11:20:38.032 security: error: client 127.0.0.1#29403: view public: request has invalid signature: TSIG domain2.com.au.: tsig verify failure (BADKEY)

从这个nsupdate:

  1. nsupdate -k Kdomain2.com.au.+157+35454.key
  2. server localhost
  3. zone domain2.com.au.
  4. update add test.domain2.com.au. 86400 IN A 10.20.30.40
  5. show
  6. send

我收集的是CORRECT生成方法

  1. dnssec-keygen -a HMAC-MD5 -b 512 -n HOST domain2.com.au.

named.conf(IP已被更改为隐私):

  1. acl ipv4 { 0.0.0.0/0; };
  2. acl ipv6 { 2000::/3; ::1; fe80::/10; fec0::/10; };
  3. acl safehosts { 127.0.0.0/8; 3.2.2.40; 44.44.14.12; };
  4.  
  5. include "/etc/bind/rndc.key";
  6.  
  7. controls {
  8. inet * port 953
  9. allow { safehosts; } keys { "rndc-key"; };
  10. };
  11.  
  12. options
  13. {
  14. auth-nxdomain yes;
  15. empty-zones-enable no;
  16. zone-statistics yes;
  17. dnssec-enable yes;
  18. listen-on { any; };
  19. listen-on-v6 { any; };
  20. directory "/etc/bind/db";
  21. managed-keys-directory "/etc/bind/keys";
  22. memstatistics-file "/etc/bind/data/bind.memstats";
  23. statistics-file "/etc/bind/data/bind.qstats";
  24. };
  25.  
  26. logging
  27. {
  28. ## CUT ##
  29. };
  30.  
  31. view "public"
  32. {
  33. recursion yes;
  34. allow-query-cache { safehosts; };
  35. allow-recursion { safehosts; };
  36.  
  37. zone "." IN {
  38. type hint;
  39. file "root.zone";
  40. };
  41.  
  42. zone "0.0.127.in-addr.arpa" {
  43. type master;
  44. allow-update { none; };
  45. allow-transfer { none; };
  46. file "0.0.127.in-addr.arpa.zone";
  47. };
  48.  
  49. zone "localhost" {
  50. type master;
  51. allow-update { none; };
  52. allow-transfer { none; };
  53. file "localhost.zone";
  54. };
  55.  
  56. zone "3.2.2.in-addr.arpa" {
  57. type master;
  58. allow-update { none; };
  59. allow-transfer { none; };
  60. file "3.2.2.in-addr.arpa.zone";
  61. };
  62.  
  63. zone "domain1.com.au" {
  64. type master;
  65. notify yes;
  66. allow-update { key "rndc-key"; };
  67. allow-transfer { key "rndc-key"; };
  68. file "domain1.com.au.zone";
  69. };
  70.  
  71. zone "domain2.com.au" {
  72. type master;
  73. notify yes;
  74. allow-update { key "rndc-key"; };
  75. allow-transfer { key "rndc-key"; };
  76. file "doomain2.com.au.zone";
  77. };
  78. };

/etc/bind/rndc.key:

  1. key "rndc-key" {
  2. algorithm hmac-md5;
  3. secret "vZwCYBx4OAOsBrbdlooUfBaQx+kwEi2eLDXdr+JMs4ykrwXKQTtDSg/jp7eHnw39IehVLMtuVECTqfOwhXBm0A==";
  4. };

Kdomain1.com.au. 157 35454.private

  1. Private-key-format: v1.3
  2. Algorithm: 157 (HMAC_MD5)
  3. Key: vZwCYBx4OAOsBrbdlooUfBaQx+kwEi2eLDXdr+JMs4ykrwXKQTtDSg/jp7eHnw39IehVLMtuVECTqfOwhXBm0A==
  4. Bits: AAA=
  5. Created: 20130814144733
  6. Publish: 20130814144733
  7. Activate: 20130814144733

解决方法

nsupdate有一些怪癖,并在使用-k调用时采用一些命名约定.从手册页中,我认为您的密钥名称可能会以某种方式被称为domain2.com.au.

你可以试试以下吗?

  1. nsupdate -y \
  2. 'rndc-key:vZwCYBx4OAOsBrbdlooUfBaQx+kwEi2eLDXdr+JMs4ykrwXKQTtDSg/jp7eHnw39IehVLMtuVECTqfOwhXBm0A=='

猜你在找的Linux相关文章