Using bind9 to set up intelligent DNSmdash; mdash; PostgreSQL database
Using bind9 to set up intelligent DNSmdash; mdash; PostgreSQL database
How smart DNS works:
When a user resolves a domain name, the user'sIP, And then followDNSServerInternalIPMatch the table to see if the user is a telecom or Netcom user, and then return the correspondingIPAddress. Currently, domain name service providers do not provide intelligenceDNSService, so you must set up your ownDNSService or free online intelligenceDNSService, suchDNSPOD
In this example, I set up a simple internal and external resolution mode. To add other categories (China Telecom and China Netcom), you only need to add the view.
Bind has been integrated with the bind-dlz database module a long time ago. It supports data sources such as sqlbench and bdb Mysql PostgreSQL odbc ldap. For details, see:
This deployment uses PostgreSQL as the data source, and the database has been prepared (you can use an existing database system to create a new database ).
1. configuration instructions
Two views
Local internal network
Any other (Public Network)
2. Create databases and tables and add basic records
# Zone sample.com
The method for adding other domain names is similar. Replace the zone item with the corresponding domain name.
3. bind compilation and installation and configuration
By default, the rpm package does not support the dlz mode and requires source code compilation.
Or
The following installation path is the default system path
Configuration file/etc/named. conf
Other configuration file paths:/etc/named/
4. Create related configuration files
Check whether the/etc/rndc. key file exists. If not, generate
Rndc-confgen-a-c rndc. key
The key name in the default rndc. key File seems to be rndckey
The manually generated key name is rndc-key.
The key names must be consistent. Otherwise, the rndc cannot be used for refresh and cannot be synchronized.
Use Dnssec-keygen generates view TSIG key
Dnssec-keygen-a hmac-md5-B 128-n HOST local
Dnssec-keygen-a hmac-md5-B 128-n HOST any
Enter the generated key in the location corresponding to named. conf.
For example:
For details, see the complete configuration file below. This configuration file contains two methods: file storage and database (database storage has been watched out). The file storage method already includes TSIG synchronization between master slave.
And use their respective keys in different views for synchronization.
Complete named. conf content