O'Reilly logo

DNS & Bind Cookbook by Cricket Liu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Multiple Data Files for a Single Zone

Problem

You want to break a zone into multiple data files, possibly to organize the large number of resource records logically.

Solution

Use the $INCLUDE control statement in your top-level zone data file, which interpolates the contents of another file. For example, to include the contents of the file db.foo.example.hosts into the data file for the zone foo.example, you could use this $INCLUDE control statement:

$INCLUDE db.foo.example.hosts

Discussion

The origin in the included file is, by default, the same as the origin in the file that includes it. If you’d like to change the origin in the included file, specify the new origin as the second argument to the $INCLUDE control statement:

$INCLUDE db.subdomain.foo.example.hosts subdomain.foo.example

On the line after the $INCLUDE statement, the origin reverts to its previous setting.

See Also

Section 2.9, which explains how to create a subdomain within the same zone.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required