Erro de configuração nomeado no centos 6.9

0

estou recebendo este erro quando eu tento executar /etc/init.d/named restart no meu vm o que devo fazer para resolver esse problema a saída de erro é a seguinte:

[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]

meu arquivo named.conf é o seguinte:

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";

mesmo depois de substituir o último arquivo de chave, estou recebendo este problema.

[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 ~]$

Depois de remover o bind-chroot, recebo a seguinte mensagem de erro:

[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]

e aqui está o meu conteúdo do arquivo /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; };
};

aqui está o arquivo de encaminhamento:

$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

aqui está o arquivo chave:

server1.shancked.com. {
algorithm hmac-md5;
secret sml8ZD7dKHzINlkIjZRD0w==;

};

depois de atualizar o arquivo de chave, recebo o seguinte erro:

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";

arquivo server.key:

key server1.example.tv {
algorithm hmac-md5;
secret "EeLHcvOPr4cCaEySX1jBbw==";

};

mensagem de erro:

[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]
    
por jackal4me 31.01.2018 / 15:44

1 resposta

0

Sua declaração de chave está incorreta.

server1.shancked.com. {
    algorithm hmac-md5;
    secret [base64_secret];
};

deve ser

key "key_name" {
    algorithm hmac-md5;
    secret "[base64_secret]";
};

onde key_name deve ser referido apropriadamente em named.conf.

    
por 01.02.2018 / 12:48

Tags