Using bind9 to build a smart DNSPostgreSQL Database

Source: Internet
Author: User
Tags hmac dnssec
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

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.