Installation guide

236 Chapter 16. Berkeley Internet Name Domain (BIND)
For example, a zone file may contains the following line:
$ORIGIN domain.com
At this point, any names that are used in resource records and do not end in a trailing dot (.) will
have this domain name added to them. So, in other words, when the zone record is read by the
nameserver, the first line below will be interpreted as the second line:
ftp IN CNAME server1
ftp.domain.com. IN CNAME server1.domain.com.
Note
The use of the $ORIGIN directive is unnecessary if you name the zone in /etc/named.conf the
same as the value you would assign to $ORIGIN. The zone’s name is used as the $ORIGIN direc-
tive’s value by default.
$TTL Sets the default Time to Live (TTL) value for the zone. This is the number, in seconds,
given to nameservers that tells how long the zone’s resource records should continue to be valid. A
resource record can contains its own TTL value, which would override this directive.
Increasing this value tells remote nameservers to cache this zone’s information for a longer time.
This reduces the number of queries made concerning this zone, but it also lengthens the amount of
time required to proliferate resource record changes.
16.2.2.2. Zone File Resource Records
Zone file resource records contain columns of data, separated by whitespace, that define the record.
All zone file resource records are assigned a particular type, which designates the record’s purpose.
The following types of resource records are the most commonly used:
A — Address record, which specifies an IP address to assign to a name, as in this example:
host IN A IP-address
If the host value is omitted, then an A record points to a default IP address for the top of the
namespace. This system will be the target of all non-FQDN requests.
Consider the following A record examples for the domain.com zone file:
IN A 10.0.1.3
server1 IN A 10.0.1.5
Requests for domain.com are pointed to 10.0.1.3, while requests for server1.domain.com are
pointed to 10.0.1.5.
CNAME — Canonical name record, maps one name to another: an alias.
The next example tells named that any requests sent to the
alias-name will point to the host,
real-name . CNAME records are most commonly used to point services that use a common
naming scheme to the correct host.
alias-name IN CNAME real-name
Consider the following example. In this set up an A record binds a hostname to an IP address, while
a CNAME record points the commonly used www hostname to it.
server1 IN A 10.0.1.5
www IN CNAME server1
MX — Mail eXchange record, which tells where mail sent to a particular namespace controlled by
this zone should go.
IN MX preference-value email-server-name
In this example, the preference-value allows you to numerically rank the email servers
you would prefer to receive email for this namespace, giving preference to some email systems