$INCLUDE allows inclusion in-situ of an external file containing additional directives. It is typically used to assist in maintenance of larger DNS files, for example, you can distribute the maintenance of individual zone files to clients without exposing the global parameters or other client zones to inspection.
$INCLUDE is a standard directive defined in RFC 1035.
The RFC is silent on the topic of embedded $INCLUDEs in $INCLUDEd files - BIND 9 documentation is similarly silent. Assume they are not permitted.
RFC 1035 defines the format as:
$INCLUDE <filename> [domain-name]
The filename may be relative (to the location of the zone files) or absolute. The optional domain-name may be used to set an explicit $ORIGIN for the included file.
An included file can also contain one or more $ORIGIN directives. The scope of the $ORIGIN directives in included files is limited to the included file. $ORIGIN will revert to its value before the $INCLUDE directive.
Examples - no $ORIGIN in included file:
$ORIGIN uk.example.com. @ IN NS ns2.example.com. ; ns2.example.com services uk.example.com $INCLUDE /var/named/uk.example.com ; absolute path ... ftp IN A 192.168.35.16 ; expands to ftp.uk.example.com
The next fragments shows the contents of the included file and how they expand.
; file statements in /var/named/uk.example.com www IN A 192.168.23.15 ; expands to www.uk.example.com ... ; end of included file
Example with ORIGIN directive:
$ORIGIN uk.example.com. @ IN NS ns2.example.com. ; ns2.example.com services uk.example.com $INCLUDE french.subdomain ; relative path file ; ORIGIN reverts to value before the $INCLUDE directive ftp IN A 192.168.35.16 ; expands to ftp.uk.example.com
Included file contents containing $ORIGIN.
$ORIGIN fr.example.com. www IN A 192.168.23.15 ; expands to www.fr.example.com ... ; end of included file
Example of explicit $ORIGIN with $INCLUDE:
$ORIGIN uk.example.com. @ IN NS ns2.example.com. ; ns2.example.com services uk.example.com $INCLUDE french.subdomain fr.example.com ; relative path ; ORIGIN reverts to value before the $INCLUDE directive ftp IN A 192.168.35.16 ; expands to ftp.uk.example.com
Included file uses $INCLUDE explicit $ORIGIN.
; no $ORIGIN directive www IN A 192.168.23.15 ; expands to www.fr.example.com ... ; end of included file
Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.
Contents
tech info
guides home
dns articles
intro
contents
1 objectives
big picture
2 concepts
3 reverse map
4 dns types
quickstart
5 install bind
6 samples
reference
7 named.conf
8 zone records
operations
9 howtos
10 tools
11 trouble
programming
12 bind api's
security
13 dns security
bits & bytes
15 messages
resources
notes & tips
registration FAQ
dns resources
dns rfcs
change log
This work is licensed under a
Creative Commons License.
If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Firefox
Search
Share
Page
Resources
Systems
FreeBSD
NetBSD
OpenBSD
DragonFlyBSD
Linux.org
Debian Linux
Software
LibreOffice
OpenOffice
Mozilla
GitHub
GNU-Free SW Foundation
get-dns
Organizations
Open Source Initiative
Creative Commons
Misc.
Ibiblio - Library
Open Book Project
Open Directory
Wikipedia
Site
Copyright © 1994 - 2024 ZyTrax, Inc. All rights reserved. Legal and Privacy |
site by zytrax hosted by javapipe.com |
web-master at zytrax Page modified: January 20 2022. |