Knowledge Base ISC Main Website Ask a Question/Contact ISC
BIND 9.9 redirect zones (for NXDOMAIN redirection)
Author: Mark Andrews Reference Number: AA-00376 Views: 21751 Created: 2011-07-28 08:08 Last Updated: 2014-04-22 17:14 0 Rating/ Voters

The ability to configure a redirect zone was first introduced in BIND 9.9.0.  (BIND 9 Subscription Version and BIND 9.10 extend this by allowing BIND to provide responses based upon an API to an external user-developed module - for example, DLZ or a coded back-end.   For more details see NXDOMAIN Redirection Using DLZ in BIND 9.9 Subscription Version and NXDOMAIN Redirection Using DLZ in BIND 9.10)

What is NXDOMAIN Redirection?

NXDOMAIN redirection provides the ability for a recursive server to replace an NXDOMAIN response to a query with a configured answer of its own - usually pointing to a helpful service site.  This substitute response is returned to the original client in place of the NXDOMAIN response received by the server.  Recursive server administrators may use this redirection for their own purposes or to obtain advertising revenue from third parties who specialize in this business. 

NXDOMAIN Redirection will not override DNSSEC.

If the client has requested DNSSEC records (DO=1) and the NXDOMAIN response is signed then no substitution will occur.

How is NXDOMAIN Redirection configured?

The zone data within such a zone will often consist of a pair of (A and AAAA)  wildcard records for root, but it's also possible to add records specifically for different domains. 

The substitution supports all possible types and is not limited to A and AAAA records; any record type may be placed in a redirect zone.

For example, this would be a standard redirect zone configuration from named.conf:

zone "." {
        type redirect;
        file "db.redirect" ;
};


To redirect any A or AAAA queries to 10.100.100.2 and 2001:ffff:ffff::10.100.100.2 on NXDOMAIN, you would configure the redirect zone like this.

$TTL 300
@ IN SOA ns.example.net hostmaster.example.net 0 0 0 0 0
@ IN NS ns.example.net
;
; NS records do not need address records in this zone as it is not in the
; normal namespace.
;
*. IN A 10.100.100.2
*. IN AAAA 2001:ffff:ffff::10.100.100.2


To redirect all Spanish names (under .ES) use entries like these:

*.ES. IN A 10.100.100.3
*.ES. IN AAAA 2001:ffff:ffff::10.100.100.3


Similarly, to redirect all commercial Spanish names (under COM.ES) create entries like these:

*.COM.ES. IN A 10.100.100.4
*.COM.ES. IN AAAA 2001:ffff:ffff::10.100.100.4

The redirect zone can also hold redirect records for multiple different domains.  If the above examples were added to the same redirect zone together, then the most specific matching redirect would be used when forming a query response.


© 2001-2016 Internet Systems Consortium

Please help us to improve the content of our knowledge base by letting us know below how we can improve this article.

If you have a technical question or problem on which you'd like help, please don't submit it here as article feedback.

For assistance with problems and questions for which you have not been able to find an answer in our Knowledge Base, we recommend searching our community mailing list archives and/or posting your question there (you will need to register there first for your posts to be accepted). The bind-users and the dhcp-users lists particularly have a long-standing and active membership.

ISC relies on the financial support of the community to fund the development of its open source software products. If you would like to support future product evolution and maintenance as well having peace of mind knowing that our team of experts are poised to provide you with individual technical assistance whenever you call upon them, then please consider our Professional Subscription Support services - details can be found on our main website.

Feedback
  • There is no feedback for this article
Info Submit Feedback on this Article
Nickname: Your Email: Subject: Comment:
Enter the code below:
Quick Jump Menu