| В начало → Gentoo LDAP-DNS Guide (Англ.) → Configuring LDAP-DNS |
![]() |
First, install net-dns/ldapdns.
Next, configure ldapdns to host the DNS records for your network. We use ldapdns-conf which uses the following syntax:
| Keyword | Explanation | Example |
|---|---|---|
| acct | Username as which ldapdns will run | ldapdns |
| logacct | Username as which the ldapdns logging will run | dnslog |
| /path | Chrooted home directory for ldapdns | /var/lib/ldapdns |
| yourip | IP address to listen to | 127.0.0.1 |
| ldaphost | Address of the LDAP service | ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock |
| dn | LDAP login credentials | cn=Manager,dc=yourdomain |
| suffix | Optional default ldap path to add on all queries | ou=Machines,dc=yourdomain |
You should substitute the 127.0.0.1 IP address with an IP address that all hosts can reach and don't forget to use the domain name you want instead of yourdomain.
Листинг 3. Example ldapdns-conf run
#ldapdns-conf ldapdns dnslog /var/lib/ldapdns 127.0.0.1 ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock cn=Manager,dc=yourdomain ou=Machines,dc=yourdomain
Now set the LDAP login password:
Листинг 4. Setting the LDAP login password
#echo YourSecretPassword > /var/lib/ldapdns/root/password#chmod 0400 /var/lib/ldapdns/root/password
Now configure ldapdns to use the simple authentication method and the cosine LDAP schemas:
Листинг 5. Configuring ldapdns
#echo simple > /var/lib/ldapdns/env/LDAP_AUTH#echo cosine > /var/lib/ldapdns/env/SCHEMA
You can optionally set an e-mail address for the service:
Листинг 6. Setting a host master e-mail address
#echo YourMail@address > /var/lib/ldapdns/env/HOSTMASTE
Add the service to the supervise scan and run the service supervisor if you haven't started it already:
Листинг 7. Managing supervise services
#ln -s /var/lib/ldapdns /service#/etc/init.d/svscan start#rc-update add svscan default
| В начало → Gentoo LDAP-DNS Guide (Англ.) → Configuring LDAP-DNS |