Fusion Directory permet de gérer les zones DNS. Il existe plusieurs façon de procéder, l'une d'entre elle étant d'utiliser l'outil ldap2bind (qui permet de créer un fichier de zone bind classique en lisant les données de l'annuaire). Sur cette page, nous allons au contraire créer un environnement plus dynamique:
Les plugin suivants sont nécessaires:
Sous CentOS:
yum install fusiondirectory-plugin-systems fusiondirectory-plugin-dns
Nous allons créer un compte DSA nommé dns. Ce compte pourra accéder aux informations concernant nos zones
Il faut ensuite charger les schémas dns-fd-conf et dnszone et ajouter quelques indexes, ce qui donnera par exemple:
[...] include /etc/openldap/schema/fusiondirectory/dns-fd-conf.schema include /etc/openldap/schema/fusiondirectory/dnszone.schema [...] index zoneName eq index relativeDomainName eq [...] # Access to DNS entries access to dn.subtree=ou=servers,ou=systems,dc=firewall-services,dc=com filter=(objectClass=dNSZone) by dn=cn=dns,ou=DSA,dc=firewall-services,dc=com peername.ip="127.0.0.1" read by dn=cn=dns,ou=DSA,dc=firewall-services,dc=com peername.ip="[::1]" read by dn=cn=dns,ou=DSA,dc=firewall-services,dc=com ssf=256 read by group.exact="cn=admins,ou=Groups,dc=firewall-services,dc=com" write by * none [...]
Dans l'interface de Fusion Directory, il faut ajouter le service DNS sur un des serveurs déclarés, puis créer une zone
bind-sdb est disponible dans les dépôts de CentOS 6, il suffit donc de l'installer:
yum install bind bind-sdb bind-utils
Et de modifier le fichier /etc/named.conf:
options { listen-on port 53 { 127.0.0.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 no; dnssec-enable no; dnssec-validation no; dnssec-lookaside auto; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory "/var/named/dynamic"; querylog yes; }; logging { channel default_file { file "/var/log/named.log" size 10m; severity info; print-time yes; print-severity yes; print-category yes; }; category default{ default_file; }; }; zone "firewall-services.com." IN { type master; database "ldap ldap://localhost/dc=firewall-services,dc=com????!bindname=cn=dns%2cou=DSA%2cdc=firewall-services%2cdc=com,!x-bindpw=dsa_password 172800"; }; zone "10.10.in-addr.arpa." IN { type master; database "ldap ldap://localhost/dc=firewall-services,dc=com????!bindname=cn=dns%2cou=DSA%2cdc=firewall-services%2cdc=com,!x-bindpw=dsa_password 172800"; };
Il ne reste plus qu'à mettre unbound en place:
yum install unbound
Puis modifiez le fichier /etc/unbound/unbound.conf
server: verbosity: 1 statistics-interval: 0 statistics-cumulative: no extended-statistics: yes num-threads: 2 interface: 10.10.4.10 interface-automatic: no do-ip6: no access-control: 127.0.0.1 allow access-control: 10.10.0.0/16 allow chroot: "" username: "unbound" directory: "/etc/unbound" log-time-ascii: yes pidfile: "/var/run/unbound/unbound.pid" hide-identity: yes hide-version: yes harden-glue: yes harden-dnssec-stripped: yes harden-below-nxdomain: yes harden-referral-path: yes use-caps-for-id: no unwanted-reply-threshold: 10000000 do-not-query-localhost: no prefetch: yes prefetch-key: yes dlv-anchor-file: "/etc/unbound/dlv.isc.org.key" trusted-keys-file: /etc/unbound/keys.d/*.key auto-trust-anchor-file: "/etc/unbound/root.anchor" val-clean-additional: yes val-permissive-mode: no val-log-level: 1 local-zone: "firewall-services.com." transparent local-zone: "10.10.in-addr.arpa." transparent include: /etc/unbound/local.d/*.conf remote-control: control-enable: no server-key-file: "/etc/unbound/unbound_server.key" server-cert-file: "/etc/unbound/unbound_server.pem" control-key-file: "/etc/unbound/unbound_control.key" control-cert-file: "/etc/unbound/unbound_control.pem" include: /etc/unbound/conf.d/*.conf stub-zone: name: "firewall-services.com." stub-addr: 127.0.0.1 stub-zone: name: "10.10.in-addr.arpa." stub-addr: 127.0.0.1 forward-zone: name: "." forward-addr: 88.191.254.60 forward-addr: 88.191.254.70