Applies To:
Show Versions3-DNS Controller versions 1.x - 4.x
- 4.1.1, 4.1.0
8
Resource Records
Understanding resource records
A resource record is an entry in a DNS database file and consists of a name, a TTL, a type, and data that is specific to the type. These resource records, in a hierarchical structure, make up the domain name system (DNS).
The standard resource record format, specified in RFC 1035, is as follows:
{name} {ttl} addr-class record type record-specific data
The resource record fields are defined as follows:
- name
The first field, name, is the name of the domain record and it must always start in column 1. For all resource records that are not the first in a file, the name may be left blank. When the name field is left blank, the record takes the previous resource record. - ttl
The second field, ttl (time to live), is optional. This field specifies how long the resource record is stored by the LDNS. If this field is left blank, the default time to live value is specified in the start of authority (SOA) resource record (described later in this chapter). - address class
The third field is the address class. Currently, only one class is supported: IN, for internet addresses and other internet information. Limited support is included for the HS class, which is for MIT/Athena "Hesiod" information. - record type
The fourth field, record type, defines the type of this resource record, such as A, or NS. - other fields
Additional fields may be present in a resource record, depending on its type.
Although case is preserved in names and data fields when loaded into the name server, comparisons and lookups in the name server database are not case-sensitive.
Types of resource records
There are many types of resource records currently in use. This section provides an overview of the most common resource record types, and lists other types of resource records. The six most common types of resource records are shown in Table 8.1 .
A (Address)
The Address record, or A record, lists the IP address for a given host machine name. The name field is the host's name, and the address is the network interface address. There should be one A record for each IP address of the machine.
Figure 8.1 shows an example of an A record.
Figure 8.1 Example of an A record
{name} {ttl} addr-class {type} address
host1.domain.com IN A 128.32.0.4
IN A 10.0.0.78
CNAME (Canonical Name)
The Canonical Name resource record, CNAME, specifies an alias or nickname for the official, or canonical, host name. This record must be the only one associated with the alias name. It is usually easier to supply one A record for a given address and use CNAME records to define alias host names for that address.
Figure 8.2 shows an example of a CNAME resource record:
Figure 8.2 Example of a CNAME record
alias {ttl} addr-class {type} Canonical name
wip.domain.com IN CNAME host1.domain.com
MX (Mail Exchange)
The Mail Exchange resource record, MX, defines the mail system(s) for a given domain.
Figure 8.3 shows an example of an MX resource record.
Figure 8.3 Example of an MX record
name {ttl} addr-class MX pref value mail exchange
Munnari.OZ.AU. IN MX 0 Seismo.CSS.GOV.
*.IL. IN MX 0 RELAY.CS.NET.
NS (Name Server)
The name server resource record, NS, defines the name servers for a given domain, creating a delegation point and a subzone. The first name field specifies the zone that is serviced by the name server that is specified by the second name. Every zone needs at least two name servers.
Figure 8.4 shows an example of an NS resource record.
Figure 8.4 Example of an NS record
{name} {ttl} addr-class NS Name servers name
domain.com IN NS host1.domain.com.
domain.com IN NS host2.domain.com.
PTR (Pointer)
A name pointer resource record, PTR, associates a host name with a given IP address. These records are used for reverse name lookups.
The example of a PTR record shown in Figure 8.5 is used to set up reverse pointers for the special IN-ADDR.ARPA domain.
Figure 8.5 Example of a PTR record
name {ttl} addr-class PTR real name
7.0 IN PTR monet.Berkeley.Edu.
SOA (Start of Authority)
The start of authority resource record, SOA, starts every zone file and indicates that a name server is the best source of information for a particular zone. In other words, the SOA record indicates that a name server is authoritative for a zone. There must be exactly one SOA record per zone.
The following is an example of an SOA record.
Figure 8.6 Example of an SOA record
name {ttl} addr-class SOA Origin Person in charge
@ IN SOA ucbvax.Berkeley.Edu. johndoe.berkeley.edu (
1995122103 ; Serial
10800 ; Refresh
1800 ; Retry
3600000 ; Expire
259200 ) ; Minimum
The specific fields in an SOA record are defined as follows:
- Person in charge
The email address for the person responsible for the name server, with the at character ( @ ) changed to a dot ( . ). For example, johndoe@berkeley.edu becomes johndoe.berkley.edu. - Serial number
The version number of the data file; it must be a positive integer. You must increase this number whenever a change is made to the data. - Refresh
The time interval between calls, in seconds, that the secondary name servers make to the primary name server to check if an update is necessary. - Retry
The time interval, in seconds, that a secondary server waits before retrying a failed zone transfer. - Expire
The maximum number of seconds that a secondary name server can use the data before it expires for lack of receiving a refresh. - Minimum
The default number of seconds to be used for the time to live (TTL) field on resource records which do not specify a TTL in the zone file. It is also an enforced minimum on TTL if it is specified on a resource record in the zone.
Additional resource record types
Table 8.2 lists less common resource record types. For more information on these, see RFCs 1035, 1183, and 1664.