This article is part two in a series dedicated to the basics of DNS management, DNS Record Types. It is recommended that you read the first entry in this series, “Registrars and Nameservers,” before continuing with this article.
Zones and Records
Before we dive into various types of DNS records, it is important to understand the distinction and concept DNS Zones and DNS Records.
A DNS Record is a single entry that gives the zone instructions on how to handle any given request based on type. There are many types of DNS Records, but the ones you are most likely to encounter or need to use are:
- A Records
- MX Records
- TXT Records
- SPF Records
Each individual DNS record is assigned a type and information needed for that type of record.
A DNS Zone is like a container of all the DNS records for a specific domain and only that domain. For example: pressable-com-clone.mystagingwebsite.com, www.pressable-com-clone.mystagingwebsite.com, blog.pressable-com-clone.mystagingwebsite.com, and mail.pressable-com-clone.mystagingwebsite.com are four DNS Records inside a single DNS Zone for pressable-com-clone.mystagingwebsite.com.
In general, most every DNS record requires at least three pieces of information:
- Record Name
- Record Value/Data
- Time to Live (TTL)
A DNS Record ‘s name is the descriptor and effective subdomain of that entry. If you were adding a blog to your domain, you would create a DNS record and assign it the name “blog.” This would mean that whenever a requests attempts to use blog.pressable-com-clone.mystagingwebsite.com, the DNS zone is queried for information about a DNS record with the name of “blog.” Although you can assign whatever name you’d like to a record, there exist a few special cases you should be aware of.
Blank Name – A record that has nothing in the name slot gets used for all requests made to the base/naked form of the domain. To refer to a previous example, pressable-com-clone.mystagingwebsite.com and www.pressable-com-clone.mystagingwebsite.com are two different DNS records with separate values for their name. The www.pressable-com-clone.mystagingwebsite.com DNS record uses “www” as its record name and pressable-com-clone.mystagingwebsite.com uses nothing/blank for its record name.
@ Symbol – Some DNS management systems use the @ symbol in the “name” slot instead of the blank name entry. This is important because it allows the use of @ as another record’s value/data, meaning the other record will refer to the value of the base/naked form of the domain to know where to point.
Let’s say for instance you always wanted www.pressable-com-clone.mystagingwebsite.com to point at the same place as presable.com. You could just set them individually to point at the same place and manage them separately, but since the @ symbol represents the base/naked DNS record, you could set the www DNS record entry to have a value/data of @ and it will always refer to and use the value of the @ name record when being requested.
This is useful when multiple subdomains/records need to all point at the same place as the base/naked domain. Of course, this means you should be absolutely aware that changing the value of the @ named record effectively changes the value of any record that refers to it, so you would need to double-check any changes made to this record to see how it might affect other subdomains/records.
* Symbol (Wildcard) – It isn’t strange to see the * symbol be used as the name for a DNS record. This symbol is used as an indicator that the record named * should be used in place of any record that isn’t specified. These can be used when you would like to direct subdomains that do not exist somewhere where they can be accounted for or handled. This means that you can specify where you would like to send all traffic for subdomain that does not exist as a DNS record or that you might not expect people to visit. You could consider the * symbol to be the DNS record “for everything else.”
A DNS Record’s value or data is the information that tells the DNS record where you want it to point, or in some cases, what you want it to do. In the case of A Records and CNAMEs, the data/value represents the IP or domain, respectively, that the record name is pointed at and should refer to figure out where to go next. We saw an example of this in the use of the @ symbol as the data/value of a record to refer to the value/date of the base/naked domain DNS record.
In MX records, the value/data information indicates what mail servers email should be routed to. SPF records use the value/data field so specify what servers are allowed to legitimately use your domain name for the sending of emails.
We will talk more about valid entries for the various record types, but the value/data field of a DNS record is the part of a DNS record that makes things happen.
Time to Live (TTL)
TTL is the numerical value, in seconds, of how long a DNS record will be cached before it needs to be refreshed. Whenever a nameserver is queried for a DNS record, it will check to see if it has delivered that same DNS record within the time period specified by the TTL and if so, will deliver the cached version of that DNS record. Once that period of time specified by the TTL passes, the nameserver will query the zone for record data and cache it once more for the specified period of time.
The most important thing to know about TTL is that any changes you make to the value/data of a DNS record are subject to that TTL in regard to how long it will take for that record to start taking effect. If I change the www record of pressable-com-clone.mystagingwebsite.com and the value/data of the TTL is 60, then I know the DNS record will start taking effect within 60 seconds. If the TTL is set to 3600, then I know that it can take up to 1 hour for the new information to start taking effect.
TTL also applies to changing the TTL itself in a record. For instance, if you are switching hosts and know you are going to need to change the IP address your domain points to, you might want to lower the TTL on your DNS records so that the switch over from your old host to new host happens as quickly as possible. Simply changing the TTL from 3600 to 60 will not ensure that your IP change will take effect within 60 seconds, it simply indicates to your zone/nameservers that once they request a fresh set of information after the current 3600 second caching period, it should also adjust your TTL from that point on. This means that if you want to switch from a 3600 TTL to a 60 second TTL, you should make the TTL change at least 3600 seconds in advance of your IP change to ensure yourself the 60 second TTL period.
Understanding what a DNS record is and what each part of an entry represents is vital to understanding what your DNS records are doing and why they behave the way they do. Knowing where your record is pointing and what the TTL is set to is important in knowing when to expect your changes to take effect and begin working.
The next article in this series is about the specific uses of several different DNS record types and knowing which to use, when to use them, and how they can interact with each other.