The Domain Name System (DNS) ensures that users can enter a domain in the browser and arrive at their desired website. In fact, network par­ti­cipants primarily com­mu­nic­ate via IP addresses. However, since these are rather unwieldy, you only need to enter the website name as this is auto­mat­ic­ally trans­lated into the number sequence. How does this trans­la­tion work?

What Are DNS Records?

When you enter an internet address in the browser, the system first has to look up which IP address belongs to this domain. This sometimes occurs even in the computer’s memory itself, often in the internet provider’s database or other DNS servers, and in cases of un­cer­tainty, via one of the large root servers that monitor the entire Domain Name System as authority entities. In order to perform a name res­ol­u­tion, the DNS records, spe­cific­ally the resource records, must be searched for in the DNS and/or name servers. Here, each IP address (known to the server) is assigned a domain name.

The DNS has a hier­arch­ic­al and de­cent­ral­ised structure. At each level, there is a server that is re­spons­ible for its namespace. This means that in the search for www.example.com’s IP address, the root server only helps if it knows which server is re­spons­ible for the Top-Level Domain (TLD). In this way, the in­di­vidu­al levels are run through in order to perform the name res­ol­u­tion. This means that the IP address of the actual web server or mail server resides solely with the host itself. For this reason, it is important for website operators to un­der­stand the concept of resource records.

Free DNS hosting in the UK
Reduce page loading speeds with free DNS
  • Faster domain res­ol­u­tion to keep you online longer
  • Added pro­tec­tion against outages and downtime
  • UK-based name servers
  • No domain transfer needed

How Do DNS Records Work?

DNS records are primarily located in zone files. With respect to DNS, a zone denotes an or­gan­isa­tion­al area. It is possible for a domain to consist of a single zone. Extensive domains, however, are often divided into several zones. Each DNS server is re­spons­ible for a zone. If a client therefore wishes to activate a specific domain, it (or more spe­cific­ally, the DNS server) has a look in the zone files for the ap­pro­pri­ate records and forwards the request to a lower-level server until the final des­tin­a­tion is reached.

DNS Record Syntax

Resource records are struc­tured according to a simple system and coded in ASCII. There is a separate line for each DNS record. The records typically follow the following format:

<name> <ttl> <class> <type> <rdlength> <radata>

The discrete in­form­a­tion is separated by a space and some kinds of in­form­a­tion are only optional. In certain types of records, ad­di­tion­al fields also appear. But what do the key record fields represent?

  • <name>: The domain name is the name that the user enters into their browser.
  • <ttl>: TTL stands for “time to live” and denotes the time (in seconds) that a record may be tem­por­ar­ily stored in the cache. After the time has lapsed, it cannot be ensured that the resource record is still current. This in­form­a­tion is optional.
  • <class>: In theory, there are different classes of DNS records. In practice, however, the records always refer to the internet (marked as IN), which is why this in­form­a­tion is also optional.
  • <type>: Different types of resource records appear in a zone file (for more on this, see below).
  • <rdlength>: This optional field specifies the size of the sub­sequent data field.
  • <rdata>: Resource data is the in­form­a­tion according to which the domain name can be resolved (such as the IP address).

The DNS record for the example.com web server thus looks like this:

www.example.com. 12879 IN A 93.184.216.34

A client can store the record for 12,879 seconds (around three and a half hours) in the cache before the in­form­a­tion must again be requested from the DNS server. It involves a DNS record on the internet (IN) and a type A record (A). The domain is resolved to an IP address.

Another notation is also possible:

$TTL 12879
$ORIGIN example.com.
www A 93.184.216.34

This notation il­lus­trates that the computer with the name www is part of the example.com domain. This way, other computers such as mail or ftp can be placed under the origin domain.

Note

The domain name ends (or begins, because you go from right to left) with a full stop. Fully Qualified Domain Names (FQDN) – in which the root label (though empty) also appears – are used in DNS records. It generally is situated after the full stop.

The Most Important DNS Record Types

A record type de­term­ines what kind of in­form­a­tion is located in the record. In addition to the res­ol­u­tion of domain names according to IP addresses, DNS records have other functions as well.

A Record

The largest portion of name res­ol­u­tion on the internet takes place via the type A record. An IPv4 address is located in its data field. Through these records, it is possible for the internet user to enter a domain name in the browser and for the client to send an HTTP request to the ap­pro­pri­ate IP address. Since an IPv4 address always has a size of 4 bytes, the value under rdlength – if specified – is always 4.

AAAA Record

An AAAA record, also known as “quad A”, functions exactly like the A record. However, it uses an IPv6 address instead of an IPv4 address to resolve the name. Because IPv6 has a length of 128 bits (16 bytes), the data field length is also pre­defined here. The AAAA des­ig­na­tion is based on the fact that the data field has four times the length of an A record data field.

SOA Record

SOA stands for Start of Authority. The records for this type contain in­form­a­tion on the zone that is organised by the zone file and/or the DNS server. This is important – among other scenarios – during a zone transfer. Here, zone files are mirrored to other servers in order to prevent failures. The zone transfer regulates the periodic dis­tri­bu­tion of the original file. In this kind of DNS record, a serial number is therefore also placed next to the mailing address of the re­spons­ible ad­min­is­trat­or. This increases with each file update.

CNAME Record

Under a CNAME record (canonical name record), one finds an alias – an ad­di­tion­al name for a domain. Using this, the record refers to an existing A record or AAAA record. With this type, the rdata field is filled with a domain name that was pre­vi­ously linked with an IP address in the file. In this way, different addresses can refer to the same server.

MX Record

An MX record refers to a mail exchange or an SMTP email server. One or several email servers are defined here that belong to the relevant domain. When using several mail servers (for example, to offset a failure), they specify different priority levels. In this way, the DNS knows in which sequence the contact attempt should proceed.

PTR Record

The PTR record (pointer) is a DNS record that permits a reverse lookup. Through this technique, the DNS server can also provide in­form­a­tion regarding which host names belong to a specific IP address. For every IP address that is used in A or AAAA records, there also exists a cor­res­pond­ing PTR record. At the same time, the IP address is struc­tured in reverse sequence and is also provided with the name of a zone.

NS Record

In the NS record – a zone file’s name server record – the jur­is­dic­tion for a specific zone is clarified. For this reason, this record is mandatory for each zone file. This resource record gives the DNS server in­form­a­tion on whether it is re­spons­ible for the request – thus requiring it to organise the relevant zone – and to whom it must forward the request.

TXT Record

The TXT record contains text that either is intended for human users as an in­form­a­tion source or is machine-readable in­form­a­tion. This DNS record gives an ad­min­is­trat­or the option of storing un­struc­tured Text (in contrast to the struc­tured data of the other DNS records). This could also include details about the company behind the domain.

SRV Record

Via the SRV record, a server can provide in­form­a­tion about other services (SRV). For this purpose, the service, including the port at which it can be reached, is specified. In addition, the used protocol forms part of the name. Via the DNS record, a client can receive in­form­a­tion on LDAP or XMPP services.

LOC Record

Through the LOC record, the location of the physical server can be disclosed. For this purpose, the latitude, longitude, height above sea level as well as an error deviation are specified at the end of the record.

Tip

Learn more about "What is DNS propaga­tion?" in our Digital Guide article on the topic.

Zone File

In the zone file (a type of simple text file), all of the DNS records are listed. In order for the data to be correctly processed, specific guidelines must be observed. Otherwise the DNS cannot function, and the client will receive the SERVFAIL error message. For this reason, it is necessary to adhere to a special structure: Initially the zone name is specified, and then, in many cases, the TTL. Adding the time in­form­a­tion right here has the advantage that, in the in­di­vidu­al resource records, the in­form­a­tion can be omitted. The TTL is then valid globally for the entire zone.

$ORIGIN example.com.
$TTL 12879

The first DNS record is a SAO record. Without this, a zone file cannot function. Con­versely, a zone file is then also valid only if the SOA record is available. After that, there are the first records for the name server, and then the A and AAAA records.

If comments are to be added within the file – for example, to make work easier for other ad­min­is­trat­ors –semi­colons should be used. This way, in­form­a­tion is created about a DNS record without the server pro­cessing the text. You can insert empty lines to structure your records. These are also simply ignored by the system during the readout. One line is used per record; a line break finalises the record. If you want to have a record run over several lines, however, you should then add brackets.

All DNS Record Types in Summary

In addition to those mentioned above, there are many other possible resource record types that can be found in the zone files – even if not all that often. The following table in­tro­duces all the types and provides some brief insight into their functions.

Note

The Internet Assigned Numbers Authority (IANA), which also has the al­loc­a­tion of IP addresses among its re­spons­ib­il­it­ies, has assigned each DNS record type a value (like a kind of iden­ti­fic­a­tion number).

Value Type De­scrip­tion
1 A Address specifies a host’s IPv4 address.
2 NS Nameserv­er clarifies the zone’s authority.
3 MD Mail Des­tin­a­tion was replaced by the MX record (obsolete).
4 MF Mail Forwarder was replaced by the MX record (obsolete).
5 CNAME Canonical Name defines an alias.
6 SOA Start of Authority discloses details about the zone.
7 MB Mailbox Domain Name is ex­per­i­ment­al.
8 MG Mail Group Member is ex­per­i­ment­al.
9 MR Mail Rename Domain Name is ex­per­i­ment­al.
10 NULL Null Resource is ex­per­i­ment­al.
11 WKS Well Known Service was used for mail for­ward­ing (now obsolete).
12 PTR Pointer is intended for reverse lookup.
13 HINFO Host In­form­a­tion supplies the host’s hardware and software details.
14 MINFO Mailbox In­form­a­tion is ex­per­i­ment­al.
15 MX Mail Exchange assigns email servers a domain.
16 TXT Text provides the option of entering ad­di­tion­al texts.
17 RP Re­spons­ible Person provides in­form­a­tion on the re­spons­ible person.
18 AFSDB AFS Database is spe­cific­ally intended for AFS clients.
19 X25 X.25 PSDN Address provides details on en­cap­su­la­tion via X.25 (obsolete).
20 ISDN This record assigns the DNS name an ISDN number (obsolete).
21 RT Route Through Record provides route-through binding without a WAN address (obsolete).
22 NSAP This record enables as­sign­ment of domain names to Network Service Access Points (obsolete).
23 NSAP-PTR NSAP Pointer was replaced by PTR (obsolete).
24 SIG Signature was replaced by RRSIG (obsolete).
25 KEY Key was replaced by IPSECKEY (obsolete).
26 PX Pointer to X.400 specifies MIXER mapping reg­u­la­tions (obsolete).
27 GPOS Geo­graph­ic­al Position was replaced by LOC (obsolete).
28 AAAA AAAA provides a host’s IPv6 address.
29 LOC Location contains location in­form­a­tion.
30 NXT Next was replaced by NSEC (obsolete).
31 EID Endpoint Iden­ti­fi­er is intended for Nimrod Routing Ar­chi­tec­ture (obsolete).
32 NIMLOC Nimrod Locator is intended for Nimrod Routing Ar­chi­tec­ture (obsolete).
33 SRV Service Locator provides in­form­a­tion about other services.
34 ATMA ATM Address provides in­form­a­tion when there are asyn­chron­ous transfer modes (obsolete).
35 NAPTR Naming Authority Pointer is an A record extension that permits the search pattern (regular ex­pres­sions).
36 KX Key Exchanger enables key man­age­ment for cryp­to­graphy.
37 CERT Cert saves cer­ti­fic­ates.
38 A6 A6 was replaced by AAAA.
39 DNAME Del­eg­a­tion Name specifies the aliases for complete domains.
40 SINK Kitchen Sink enables the storage of various data (obsolete).
41 OPT Option is a pseudo-record when there is a DNS extension mechanism (EDNS).
42 APL Address Prefix List lists address areas in CIDR format.
43 DS Del­eg­a­tion Signer iden­ti­fies DNSSEC-signed zones.
44 SSHFP SSH Public Key Fin­ger­print discloses the fin­ger­print for SSH keys.
45 IPSECKEY IPsec Key contains an IPsec key.
46 RRSIG RR Signature contains a digital signature for DNSSEC.
47 NSEC Next Secure threads signed zones in DNSSEC.
48 DNSKEY DNS Key contains a public key for DNSSEC.
49 DHCID DHCP Iden­ti­fi­er links domain names with DHCP clients.
50 NSEC3 Next Secure 3 is an al­tern­at­ive to NSEC.
51 NSEC3PARAM This record contains Parameter for NSEC3.
52 TLSA This record issues an TLSA Cer­ti­fic­ate As­so­ci­ation with a domain name per­tain­ing to DANE.
53 SMIMEA This record issues a S/MIME Cer­ti­fic­ate As­so­ci­ation with a domain name.
54 n/a Un­as­signed
55 HIP Host Identity Protocol separates endpoint markers and po­s­i­tion­ing functions from IP addresses.
56 NINFO NINFO provides in­form­a­tion on the zone’s status (same structure as TXT; obsolete).
57 RKEY RKEY saves keys (same structure as KEY and DNSKEY; obsolete).
58 TALINK Trust Anchor Link connects two domain names (obsolete).
59 CDS Child DS is a child copy of a DS record.
60 CDNSKEY Child DNSKEY is a child copy of a DNSKEY record.
61 OPEN­P­G­P­KEY OpenPGP Key discloses public keys.
62 CSYNC Child-to-Parent Syn­chron­isa­tion enables the re­con­cili­ation of parent and child zones (obsolete).
63 ZONEMD Message Digest for DNS Zone is ex­per­i­ment­al (obsolete).
64–98 n/a Not assigned.
99 SPF Sender Policy Framework was replaced by the TXT record (obsolete).
100 UINFO Reserved.
101 UID Reserved.
102 GID Reserved.
103 UNSPEC Reserved.
104 NID NodeID is ex­per­i­ment­al.
105 L32 32-bit Locator is ex­per­i­ment­al.
106 L64 64-bit Locator is ex­per­i­ment­al.
107 LP Locator Pointer is ex­per­i­ment­al.
108 EUI48 48-bit Extended Unique Iden­ti­fi­er encrypts addresses.
109 EUI64 64-bit Extended Unique Iden­ti­fi­er encrypts addresses.
110–248 n/a Un­as­signed.
249 TKEY Trans­ac­tion Key enables the exchange of secret keys.
250 TSIG Trans­ac­tion Signature is used for au­then­tic­a­tion.
251 IXFR In­cre­ment­al Zone Transfer enables zone file com­pon­ents to be updated on a second server (obsolete).
252 AXFR AFXR transfers a complete zone file to a second server (obsolete).
253 MAILB Mailbox queries records related to a mailbox (obsolete).
254 MAILA Mail Agent was replaced by MX-Record (obsolete).
255 * * requests all records (obsolete).
256 URI Uniform Resource Iden­ti­fi­er discloses the mapping of host names to URIs.
257 CAA Cer­ti­fic­ate Authority Au­thor­iz­a­tion specifies a domain’s possible CAs.
258 AVC Ap­plic­a­tion Vis­ib­il­ity and Control contains ap­plic­a­tion metadata for DNS-AS (obsolete).
259 DOA DOA is no longer active (obsolete).
260 AMTRELAY Automatic Multicast Tunneling Relay enables the finding of AMT relays (obsolete).
261–32767 n/a Un­as­signed.
32768 TA DNSSEC Trust Au­thor­it­ies enables DNSSEC without signed root.
32769 DLV DNSSEC Lookaside Val­id­a­tion discloses trust anchors beyond the standard DNS chain.
32770–65279 n/a Un­as­signed.
65280–65534 n/a For private use.
65535 n/a Reserved.
Go to Main Menu