The Domain Name System (DNS) is the Internet's phone book. It maps names such as www.example.org to addresses and other records. The examples below use addresses reserved for documentation; replace them with your service's addresses.

What is in a Domain?

What is commonly referred to as a 'domain' is actually made up of multiple parts. For example www.example.org is made up of:

  1. www the subdomain
  2. example.org the registered domain
  3. .org the Top Level Domain (TLD)

The Zone

A zone describes a group of DNS records managed together. It includes names below its origin, except where a subdomain has been delegated to a separate zone.

For example the zone for example.org could look like:

$ORIGIN example.org.
$TTL 3600
@ IN SOA ns1.example.org. hostmaster.example.org. (
    2026101201 ; serial
    3600       ; refresh
    900        ; retry
    1209600    ; expire
    300        ; negative-cache lifetime
)
@    IN NS   ns1.example.org.
@    IN NS   ns2.example.org.
ns1  IN A    192.0.2.53
ns2  IN A    198.51.100.53
@    IN A    192.0.2.10
www  IN A    192.0.2.10
www  IN AAAA 2001:db8::10
mail IN A    192.0.2.20
@    IN MX   10 mail.example.org.
ftp  IN CNAME www.example.org.

Hosted DNS providers commonly manage the SOA and apex NS records. If you maintain a BIND zone file yourself, supply these records and check the file with named-checkzone before loading it.

In a zone file, @ represents the origin. Names ending in a dot are complete; relative names are expanded using $ORIGIN. Web interfaces may instead expect a full hostname or only its subdomain label.

For a typical domain setup, the zone origin is example.org; www.example.org is a record within that zone. A separately delegated subdomain has its own zone.

Records

A record is an entry in the DNS phone book. Depending on the requested type, an answer can contain addresses (A or AAAA), an alias to another name (CNAME), mail servers (MX), text (TXT), or other information.

A/AAAA Record

An A record matches a queried name to an IP address. This queried name is the full hostname as it appears in the url e.g www.x4b.net, x4b.net or doesnotexist.x4b.net. In other words, it points your domain name to an IP address, which allows traffic to reach your Website, Gameserver or other service. This is the core functionality of DNS. A typical A record looks like the following:

example.org.          A       192.0.2.10

A records for sub-domains use the same format:

ipv6.example.org.          A       192.0.2.10

You can point an A record at your X4B protected IPv4 address. Where your DNS provider supports the required setup, use the service alias shown in the Dashboard so X4B can manage address changes. See CNAME and root records below.

AAAA Record

The AAAA record is the IPV6 variant of the A record. It has the same format, except that an IPV6 value is provided instead.

ipv6.example.org.          AAAA       2001:db8::10

A single sub-domain can have both A records and AAAA records. The client software, and network will be responsible for choosing the appropriate record. e.g

www.example.org.          AAAA       2001:db8::10
www.example.org.          A          192.0.2.10

CNAME Record

A CNAME record points one name to another, the canonical name. The resolver follows that alias to obtain the requested records.

One use of this record is most useful in preventing duplicate definitions when running multiple services on a single IP. For example instead of

irc.example.org.          A          192.0.2.20
www.example.org.          A          192.0.2.10
ftp.example.org.          A          192.0.2.10

a configuration utilizing CNAME records could be used

irc.example.org.          A          192.0.2.20
www.example.org.          A          192.0.2.10
ftp.example.org.      CNAME          www.example.org.

Another common use, and what is used on X4B services is to allow a third party domain administrator to make changes or perform advanced configuration (e.g GeoDNS) in a central location. In this case the CNAME record points to an external domain defined by a DNS server controlled by the third party. e.g.

irc.example.org.          A          192.0.2.20
www.example.org.       CNAME         lease-xxxxxx.clients.x4b.me.

In the example given, lease-xxxxxx.clients.x4b.me would be returned on a query for www.example.org the resolver would then look up lease-xxxxxx.clients.x4b.me

MX Record

Mail eXchange records define one or many servers to attempt to deliver mail to for a specific domain. When a domain has no MX records, SMTP can fall back to its A/AAAA records. To explicitly declare that a domain accepts no mail, publish a null MX (example.org. IN MX 0 .).

Multiple MX records can be defined with varying priorities. The MX record with the lowest numerical preference is tried first.

Load Distribution

Equal-preference MX records can distribute delivery attempts across mail servers. Sending servers choose their order, so the traffic split can vary.

Backup MX

A target server, i.e. one that knows how to deliver to the relevant user's e-mail mailbox is typically one which is the most preferred. Servers with higher numerical preference values, also called backup or secondary MX servers, usually keep the messages in a queue waiting for the primary server to become available. If both servers are online or in some way connected to one another, the backup MX will typically queue a message briefly and immediately forward it to the primary MX. The backup MX acts as a store-and-forward mail server. Configure it to accept and relay mail for the domain; the DNS record alone does not enable that behavior.

See SMTP mail routing and null MX records for details.

NS Record

NS records identify authoritative nameservers for a zone. A delegation also needs the correct NS records in the parent zone, usually configured through your registrar. X4B manages the zone's nameserver records in its DNS system. Set the registrar delegation to the nameservers shown in the Dashboard.

PTR Record

A PTR Record is a record used to define the Reverse DNS (rDNS) value of an IP address. These records do not appear in your own domain zones and exist within the .arpa TLD.

An example for a PTR record for the IPv4 address (1.2.3.4) could be

4.2.3.1.in-addr.arpa.          PTR          dns-example.x4b.net.

You can set PTR records (rDNS) from the IP Addresses page of your service in the X4B Dashboard.

SOA

An SOA (Start of Authority) record contains zone administration and timing information. Every zone has one. X4B adds and manages this record for zones in its DNS manager, so you do not need to add it yourself.

DKIM & SPF

A DKIM record is used to store the DomainKeys Identified Mail public key for verification with the signatures of received outgoing mail. Verification establishes the signing domain and the integrity of signed content. The signing domain can differ from the visible From address; DMARC uses alignment with that address when applying the domain's authentication policy.

SPF identifies servers authorized to send for an SMTP envelope domain or HELO identity. Publish the policy in a TXT record. An example of what this could look like is:

example.org. IN TXT "v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a -all"

"v=" defines the version of SPF used (spf1). Following is the mechanisms to use to determine if for a domain a sender is eligible to send mail. The "ip4" and "a" specify the systems permitted to send messages for the given domain. The "-all" at the end specifies that, if the previous mechanisms did not match, SPF returns a fail result. The receiving server decides how to handle that result.

For more information see the SPF specification and the DKIM specification

TXT

A TXT record contains one or more character-strings. Each string can hold up to 255 data octets, plus its length octet. Longer values can span several strings within one record, following the consuming application's rules. TXT records are used for features such as SPF and domain verification. See DNS record syntax.

Less Basic Features

These features help organize records and distribute traffic.

Round Robin

Multiple address records for one name can distribute connections across servers. For example,

www.example.org.          A          192.0.2.20
www.example.org.          A          192.0.2.10

Clients can select either address. Resolver ordering, client behavior, caching and connection reuse affect the traffic split. Plan for uneven load and test failover.

Root Records

Root records are records that are defined for the domain name of the zone itself. i.e example.org. These records may be represented in many ways.

The simplest way would be the full name:

example.org.          A          192.0.2.20

Some web-based user interfaces however require the @ symbol to be used for the root record, these are commonly systems that only take the subdomain (and not {subdomain}.domain.com) for record names. For example:

@            A          192.0.2.20
www          A          192.0.2.20

Another way this could be represented is with an empty record name.

Root record as CNAME

A zone apex needs SOA and NS records. An ordinary CNAME cannot coexist there with those records. Some DNS providers offer an alias or flattening feature that supplies address records at the apex.

Follow your provider's documented apex-alias method and check compatibility with your service. In X4B's DNS manager, use the "X4B Service" record type to link the root record to your service, including geolocated or multihomed services.

For more information see:

See DNS propagation for caching and migration timing.