가상 머신에서 /etc/init.d/named restart를 실행하려고 하면 이 오류가 발생합니다. 이 문제를 해결하려면 어떻게 해야 합니까? 오류 출력은 다음과 같습니다.
[shan@server1 ~]$ sudo /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: /etc/init.d/named: line 115: 2072 Aborted /usr/sbin/named-checkconf $ckcf_options ${named_conf} > /dev/null 2>&1
Error in named configuration:
/etc/named.conf:163: bad secret 'bad base64 encoding'
/etc/named.conf:163: bad secret 'bad base64 encoding'
/etc/named.conf:163: bad secret 'bad base64 encoding'
mem.c:1246: REQUIRE(ctx->references == 1) failed.
[FAILED]
내 명명된.conf 파일은 다음과 같습니다.
Code: Select all
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone shancked.com IN{
type master;
file "forward";
allow-update{none;};
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
마지막 키 파일을 교체한 후에도 여전히 이 문제가 발생합니다.
[shan@server1 ~]$ sudo vi /etc/named.conf
[shan@server1 ~]$ sudo named-checkconf /etc/named.conf
[shan@server1 ~]$ sudo /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: /etc/init.d/named: line 115: 2278 Aborted /usr/sbin/named-checkconf $ckcf_options ${named_conf} > /dev/null 2>&1
Error in named configuration:
/etc/named.conf:163: bad secret 'bad base64 encoding'
/etc/named.conf:163: bad secret 'bad base64 encoding'
/etc/named.conf:163: bad secret 'bad base64 encoding'
mem.c:1246: REQUIRE(ctx->references == 1) failed.
[FAILED]
[shan@server1 ~]$
Bind-chroot를 제거한 후 다음 오류 메시지가 나타납니다.
[shan@server1 ~]$ sudo service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
forward:8: unknown RR type '@'
forward:9: unknown RR type 'server1'
forward:10: unknown RR type 'server2'
zone shancked.com/IN: loading from master file forward failed: unknown class/type
zone shancked.com/IN: not loaded due to errors.
_default/shancked.com/IN: unknown class/type
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[FAILED]
이것은 내 /etc/named.rfc1912.zones 파일의 내용입니다.
zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
전달된 파일은 다음과 같습니다.
$TTL 1D
$ORIGIN example.tv.
@ IN SOA server1.example.tv. root.server.example.tv. (
2018020211 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
;
;
@ IN NS server1.example.tv.
server1 IN A 10.0.2.17
server2 IN A 10.0.2.16
키 파일은 다음과 같습니다.
server1.shancked.com. {
algorithm hmac-md5;
secret sml8ZD7dKHzINlkIjZRD0w==;
};
키 파일을 업데이트한 후 다음 오류가 발생합니다.
zone example.tv IN {
type master;
file "forward";
allow-update { key server1.example.tv; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named/server.key";
서버 키 파일:
key server1.example.tv {
algorithm hmac-md5;
secret "EeLHcvOPr4cCaEySX1jBbw==";
};
에러 메시지:
[shan@server1 named]$ sudo service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
forward:11: unknown RR type '@'
forward:12: unknown RR type 'server1'
forward:13: unknown RR type 'server2'
zone example.tv/IN: loading from master file forward failed: unknown class/type
zone example.tv/IN: not loaded due to errors.
_default/example.tv/IN: unknown class/type
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[FAILED]
답변1
키 선언이 올바르지 않습니다.
server1.shancked.com. {
algorithm hmac-md5;
secret [base64_secret];
};
~해야 한다
key "key_name" {
algorithm hmac-md5;
secret "[base64_secret]";
};
key_name
위치는 명명된.conf에서 적절하게 참조되어야 합니다.