Including Other Datafiles

To continue our example of editing zone datafiles by hand: once you’ve subdivided your domain like this, you might find it more convenient to keep the subdomain records in separate files. The $INCLUDE statement would let you do this:

$ORIGIN classics.movie.edu. 
$INCLUDE classics.dns

$ORIGIN comedy.movie.edu. 
$INCLUDE comedy.dns

To simplify the file even further, the new origin can be specified on the $INCLUDE line:

$INCLUDE classics.dns classics.movie.edu. 
$INCLUDE comedy.dns   comedy.movie.edu.

When you specify the origin on the $INCLUDE line, it applies only to the particular file that you’re including. For example, the comedy.movie.edu origin applies only to the names in comedy.dns. After comedy.dns has been included, the origin returns to what it was before $INCLUDE, even if comedy.dns contained an $ORIGIN entry.

Remember that, strictly speaking, you don’t need to know anything about these directives to create subdomains with the DNS console, and the Microsoft DNS Server doesn’t generate zone datafiles using these shortcuts. But you do need to know about them to complete your knowledge of zone datafiles.

Get DNS on Windows Server 2003, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.