Network Basics | DNS Records
What Does DNS Record Mean?
A DNS record is a database record used to map a URL to an IP address. DNS records are stored in DNS servers and work to help users connect their websites to the outside world. When the URL is entered and searched in the browser, that URL is forwarded to the DNS servers and then directed to the specific Web server. This Web server then serves the queried website outlined in the URL or directs the user to an email server that manages the incoming mail.
The most common record types are A (address), CNAME (canonical name), MX (mail exchange), NS (name server), PTR (pointer), SOA (start of authority) and TXT (text record).
Let's try to understand DNS workflow with the below example.
Different types of DNS records are as follows:
Name Server (NS) Record: Describes a name server for the domain that permits DNS lookups within several zones. Every primary, as well as secondary name server, must be reported via this record.
Mail Exchange (MX) Record: Permits mail to be sent to the right mail servers located in the domain. Other than IP addresses, MX records include fully-qualified domain names.
Address (A) Record: Used to map a hostname to an IP address. Generally, A records are IP addresses. If a computer consists of multiple IP addresses, adapter cards, or both, it must possess multiple address records.
Canonical Name (CNAME) Record: This can be used to set an alias for the hostname
Text (TXT) Record: Permits the insertion of arbitrary text into a DNS record. These records add SPF records into a domain.
Time-to-Live (TTL) Record: Sets the period of data, which is ideal when a recursive DNS server queries the domain name information
Start of Authority (SOA) Record: Declares the most authoritative host for the zone. Every zone file should include an SOA record, which is generated automatically when the user adds a zone.
Pointer (PTR) Record: Creates a pointer, which maps an IP address to the hostname in order to do reverse lookups.
DNS Records Extra Shot.
DNS records are an essential part of getting websites to operate correctly. They serve as a map that tells the DNS server (or the digital database that lists every website on the internet) which domain every IP address is associated with, and how they should handle the access requests sent to them.
Various DNS record strings serve as commands on how the server should approach them, and they ensure that your site functions the way you intend it to. Although there are various types of DNS records that all perform different actions, these four record types are the most commonly used.
A records
What is an A record?
Address records, commonly known as host records, resolve IP addresses. They connect the domains you register to the correct IP address so that your website will properly resolve when someone types in your web address.
When do you use an A record?
Records are used when you want to connect a domain name you’ve registered with a hosted website. Usually, two A records are set up that will successfully point to both a bare and wildcard version of the domain (i.e., yoursite.com and http://yoursite.com). Additional A records can also be created for subdomains as well.
CNAME records
What is a CNAME record?
CNAME records, or Canonical Name Records, only resolve to domains and subdomains. Unlike A records, they cannot be bare (i.e., there needs to be www. in front of them for the URL to properly resolve).
When do you use a CNAME record?
Why would you use a CNAME record instead of an A record? Well, CNAME records are most often used when you want to direct part of your website to an external link. For example, if you wanted to set up an eCommerce site to complement your existing website, a CNAME record would be the simplest way to link them together.
MX records
What is an MX record?
MX stands for Mail Exchange and is very different from other records. Unlike most DNS records that resolve to text or the destinations of various IP addresses, MX records are used to direct emails sent to custom addresses associated with a domain name.
When do you use an MX record?
If you want to create custom email addresses through your domain name, MX records must be set up so that any emails that go to that address will be directed to the right server and delivered to you. Typically, your email provider will give you the MX records you need, and then you’ll add it to the domain it’s associated with to finish the setup.
TXT records
What is a TXT record?
As you can probably guess, a TXT record is simply a text record. Although these records cannot be used to change your domain in any way, they are useful for making it easier to search for and find your domain.
When do you use a TXT record?
Text records are most often used by services like Google. By adding certain strings of characters to your TXT file, search engines and other services are able to search for your domain as well as verify that you are the owner of the domain.
References
· https://www.name.com/blog/4-dns-record-types-you-should-know-about
Subscribe to my newsletter
Read articles from Akbar Khan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Akbar Khan
Akbar Khan
Experienced Information Technology Professional | eLearn Security Certified Professional Penetration Tester (eCPPTv2) With 5 years of hands-on experience in the Information Technology and cybersecurity domains, I have developed a comprehensive skill set in Linux, Windows OS / Windows Server, and ethical hacking. My expertise extends to system security fundamentals such as Public Key Infrastructure (PKI), cryptography, and encryption/decryption algorithms.