DNS (Domain Name System) entries take a human-friendly name, such as shop.domain.com, and translates it to an IP address. Your domain name has a DNS zone which consists of the following records:
A Records
This record used to point a hostname to an IP address. This record type can be used to point your domain name at your web host or for creating subdomains which point directly to an IP address. This is the core functionality of DNS. Most of the A records look like:
example.com A 112.33.444.55
AAAA Records
Works just like the A records, except they point to the new IPv6 address, they look similar to 3ffe:1900:4545:3:200:f8ff:fe21:67cf
example.com AAAA 3ffe:1900:4545:3:200:f8ff:fe21:67cf
CNAME Alias
A CNAME record or Canonical Name record points to domain names, as opposed to specific IP addresses. CNAME records create aliases, sending one subdomain to another. For example, you could forward example1.com to newexample.com or something similar.
example1.com CNAME newexample.com.
MX Record
An MX record or mail exchange record sets the mail delivery destination for a domain (or subdomain). A zone can have one or more Mail Exchange (MX) records.
An MX record should look like this:
domain.com MX 10 mail.domain.com. mail.domain.com A 112.33.444.55
This means that email meant for [email protected] will be routed to the email server 112.33.444.55. The email server on that server then collects the email and proceeds to distribute it to the user “john”‘.
PTR Record
You can think of the PTR record as an opposite of the A record. While the A record points a domain name to an IP address, the PTR record resolves the IP address to a domain/hostname, allowing reverse DNS queries to function.
This is mostly used as a security and an anti-spam measure wherein most of the webservers or the email servers do a reverse DNS lookup to check if the host is actually coming from where it claims to come from. The PTR records are most of the times set with your hosting provider as they are not part of your domain’s zone file.
TXT Records
A TXT record is used to store any text-based information that can be grabbed when necessary. The most common uses for TXT records are Sender Policy Framework (SPF), DomainKeys (DK), and DomainKeys Identified E-mail (DKIM). TXT records historically have also been used to contain human-readable information about a server, network, data center, and other accounting information.
domain.com TXT "google-site-verification=_CHFV1wTDZ3-CgmNNBnPkhJrvKwN_uCGps"
SRV Records
Services Resource Record (SRV) allows a service to be associated with a hostname. Any application that needs to discover where a specific service is located will initiate a query for the relevant SRV record describing the service. Here’s an example:
_sip._tcp.domain.com. 3600 IN SRV 10 40 5060 test.domain.com. _sip._tcp.domain.com. 3600 IN SRV 10 30 5060 test2.domain.com.
Here the _sip is the symbolic name for the service and _tcp represents the transport protocol. The content of the SRV record defines a priority of 10 for both records. We set a weight of 40 for the first record and 30 for the second. The priority and weight values can be used to encourage use of certain servers over others.
The final two values in the record define the port and hostname to connect to for accessing the service.