J'ai installé un nouveau serveur Centos et y ai installé bind et bind-utils. Le contenu de /etc/named.conf
est :
# create new
options {
directory "/var/named";
allow-query { localhost; 10.1.2.0/24; };
allow-transfer { localhost; 10.1.2.0/24; };
recursion yes;
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
view "internal" {
match-clients {
localhost;
10.1.2.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "amadeus.netvision" IN {
type master;
file "amadeus.netvision.lan";
allow-update { none; };
};
zone "0.0.10.in-addr.arpa" IN {
type master;
file "0.0.10.db";
allow-update { none; };
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
};
view "external" {
match-clients { any; };
allow-query { any; };
recursion no;
zone "amadeus.netvision" IN {
type master;
file "amadeus.netvision.wan";
allow-update { none; };
};
};
include "/etc/rndc.key";
# allow-query query range you permit
# allow-transfer the range you permit to transfer zone info
# recursion allow or not to search recursively
# view "internal" { *** }; write for internal definition
# view "external" { *** }; write for external definition
# For How to write for reverse resolving, Write network address reversely like below.
# 10.1.2.0/24
# network address 10.1.2.0
# range of network 10.1.2.0 - 10.0.0.255
# how to write 0.0.10.in-addr.arpa
# 172.16.0.80/29
# network address 172.16.0.80
# range of network 172.16.0.80 - 172.16.0.87
# how to write 80.0.16.172.in-addr.arpa
Lorsque j'essaie de lancer le démon nommé, j'obtiens l'erreur suivante :
[root@srv ~]# service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
/etc/named.conf:9: unknown key 'rndckey'
[FAILED]
[root@srv ~]#
Je ne comprends pas ce que je fais mal, j'ai créé le rndc.key en utilisant la commande suivante : rndc-confgen -a -c /etc/rndc.key
et il a créé la clé mais j'ai toujours la même erreur. Le fichier est présent dans le chemin correct : /etc/rndc.key
et c'est inclus dans le /etc/named.conf
fichier.