Le but est d'installer le serveur BIND pour la résolution de nom DNS.
L'exemple donné ici utilise le nom de domaine datalbi.com.
hadoop01.datalbi.com 192.168.56.201 (serveur dns) hadoop02.datalbi.com 192.168.56.202 (client) hadoop03.datalbi.com 192.168.56.203 (client)
# yum install bind-utils # yum install bind
Modification No 1 :
options {
listen-on port 53 { 127.0.0.1; 192.168.56.201; };
# 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; 192.168.56.0/24; };
Modification No 2 :
#zone "." IN {
# type hint;
# file "named.ca";
#};
zone "datalbi.com" IN {
type master;
file "forward.datalbi";
allow-update { none; };
};
zone "56.168.192.in-addr.arpa" IN {
type master;
file "reverse.datalbi";
allow-update { none; };
};
$TTL 86400
@ IN SOA localhost. root.datalbi.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS localhost.
@ IN A 192.168.56.201
@ IN A 192.168.56.202
@ IN A 192.168.56.203
hadoop01 IN A 192.168.56.201
hadoop02 IN A 192.168.56.202
hadoop03 IN A 192.168.56.203
$TTL 86400
@ IN SOA localhost. root.datalbi.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS localhost.
@ IN PTR datalbi.com.
hadoop01 IN A 192.168.56.201
hadoop02 IN A 192.168.56.202
hadoop03 IN A 192.168.56.203
201 IN PTR hadoop01.datalbi.com.
202 IN PTR hadoop02.datalbi.com.
203 IN PTR hadoop03.datalbi.com.
systemctl enable named systemctl start named
Remarque : si le firewall est activé, il faut le désactiver par "systemctl stop firewalld" puis "systemctl disable firewalld".
La commande suivante ne doit retourner aucune ligne d'erreur.
# named-checkconf /etc/named.conf
# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 DNS1="192.168.56.201" DOMAIN="datalbi.com" # systemctl restart networkLa conséquence du "restart network" est de mettre à jour automatiquement le fichier /etc/resolv.conf :
# cat /etc/resolv.conf # Generated by NetworkManager search datalbi.com nameserver 192.168.56.201
# nslookup hadoop01.datalbi.com Server: 192.168.56.201 Address: 192.168.56.201#53 Name: hadoop01.datalbi.com Address: 192.168.56.201 # nslookup 192.168.56.201 Server: 192.168.56.201 Address: 192.168.56.201#53 201.56.168.192.in-addr.arpa name = hadoop01.datalbi.com.