0

im getting this error when i try to run /etc/init.d/named restart in my vm what should i do to resolve this issue the error output is as follows:

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

my named.conf file is as follows:

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

even after replacing the last key file i'm getting this problem.

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

After removing the bind-chroot i get the following error message:

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

and here is my /etc/named.rfc1912.zones file contents:

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

here is the forward file:

$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

here is the key file:

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

};

after updating the key file i get the following error:

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

server.key file:

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

};

error message:

[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
    try inspecting or regenerating the secrets in the *.key files, which is usually base64 encoded but apparently not in your case. this is usually done with rndc-confgen for named.root.key. – thrig Jan 31 '18 at 14:51
  • I don't think this is your whole named.conf file, the error is on line 163 and what you show is only 51 lines long. – wurtel Jan 31 '18 at 15:09
  • @wurtel thats the confusing part to me too why is it showing more than the usual lines – jackal4me Jan 31 '18 at 15:26
  • It might be counting the lines from the included file as well. Move the include "/etc/named.root.key"; line to above the previous include statement, and see if that "fixes" the line number. – wurtel Jan 31 '18 at 15:40
  • @wurtel i still face the same problem – jackal4me Jan 31 '18 at 15:56
0

Your key declaration is incorrect.

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

Should be

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

where key_name should be referred to appropriately in named.conf.

  • now it says like this Error in named configuration: /etc/named/server.key:1: unknown option 'server1.example.tv.' [FAILED] – jackal4me Feb 1 '18 at 12:04
  • I assume you've tried to start a key declaration with server1.example.tv. { ... when it should be of the form key "key_name" { .... Make sure you understand what TSIG keys are and what they're used for. It almost looks like you're trying to do DNSSEC... – Torin Feb 1 '18 at 12:16
  • again the same problem bro it is spewing out the first error message again – jackal4me Feb 1 '18 at 12:36
  • the keys name is server1.example.tv only – jackal4me Feb 1 '18 at 13:07
  • If your key name is server1.example.tv then you should start the key declaration with key "server1.example.tv" { – Torin Feb 1 '18 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.