Jump to content

How to configure a name server to forward some queries to other name servers

  cricketliu's Photo
Posted Sep 15 2009 08:07 AM

If you want a name server to forward queries for certain domain names to another name server, use a zone statement of type forward to tell a BIND 8.2 or later or 9.1.0 or later name server to forward queries for domain names that end in the specified suffix to particular name servers. For example:

zone "bar.example" {

    type forward;

    forwarders {; };


This tells the name server to forward queries for domain names that end in bar.example to the name server at

As with the corresponding options substatement, you can list multiple forwarders in the forwarders substatement.

An alternative to using a forward zone is to use a stub zone. Stub zones are a little like slave zones, in that the name server periodically checks with its master server to see if the zone's serial number has changed. But instead of transferring the whole zone, it retrieves just the zone's SOA and NS records, plus any necessary glue A records, using discrete queries. That's enough information to tell the name server where to begin iterative name resolution of domain names that end in the domain name of the stub zone. For example, here's a stub zone definition very similar to the forward zone defined earlier:

zone "bar.example" {

    type stub;

    masters {; };

    file "stub.bar.example";


Rather than sending a recursive query to the name server at for information about any domain name that ends with bar.example, this name server would learn the bar.example NS records, and send one of those name servers a nonrecursive query for the domain name it needed. It would then follow any successive referrals to find the answer. This is less work for the name server at, but it also requires connectivity to any name server the local name server might be referred to.

DNS & Bind Cookbook

Learn more about this topic from DNS & Bind Cookbook.

The DNS & BIND Cookbook presents solutions to the many problems faced by network administrators responsible for a name server. This title is an indispensable companion to DNS & BIND, 4th Edition, the definitive guide to the critical task of name server administration. The cookbook contains dozens of code recipes showing solutions to everyday problems, ranging from simple questions, like, "How do I get BIND?" to more advanced topics like providing name service for IPv6 addresses.

See what you'll learn

0 Subscribe

0 Replies