The tên miền name system, or DNS, is a global system responsible for mapping human-readable hostnames vĩ đại their corresponding Internet Protocol (IP) addresses. For example, if you want vĩ đại access a trang web using a tên miền name lượt thích example.com, that tên miền name must point vĩ đại a valid IP address.
The human-readable hostname is a string of words that are easy vĩ đại remember. IP addresses (IPV4), on the other hand, contain numbers separated by dots and are harder vĩ đại remember. In our example above, example.com is the human-readable hostname or tên miền name, while 93.184.216.34 is the current IP address for example.com. Also, note that the IP address associated with a tên miền name may change depending on the server hosting the trang web.
Multiple components trang điểm the tên miền name system, and DNS record types are an important part of the system. A DNS resolver does the actual work of finding the correct IP address for a hostname.
In this post, you'll learn about various DNS record types and see examples of how each record type works.
We'll start by defining what DNS record types are.
What are DNS record types?
DNS record types are records that provide important information about a hostname or tên miền. These records include the current IP address for a tên miền.
Also, DNS records are stored in text files (zone files) on the authoritative DNS server. The nội dung of a DNS record tệp tin is a string with special commands that the DNS server understands.
DNS record types
The following are the five major DNS record types:
- A record
- AAAA record
- CNAME record
- Nameserver (NS) record
- Mail exchange (MX) record
The use for each of the above types varies. So let's look at more details about each DNS record type.
1. A record
The A record is the most important DNS record type. The "A" in A record stands for "address." An A record shows the IP address for a specific hostname or tên miền. For example, a DNS record lookup for the tên miền example.com returns the following result:
Fig. 1: DNS record lookup result.
From figure 1 above, we can see that the current IP address is 93.184.216.34. The A record only supports IPV4 addresses. Later in this post, we'll see how vĩ đại point a tên miền vĩ đại an IPV6 address using another DNS record type.
Use of a record
The main use of A record is for IP address lookup. Using an A record, a trang web browser is able vĩ đại load a trang web using the tên miền name. As a result, we can access websites on the mạng internet without knowing their IP addresses.
Another use of A record is in the tên miền name system-based blackhole list (DNSBL). Here, the A record is used vĩ đại block mail from known spam sources.
2. AAAA record
AAAA record, just lượt thích A record, point vĩ đại the IP address for a tên miền. However, this DNS record type is different in the sense that it points vĩ đại IPV6 addresses.
IPV6 is an upgrade over IPV4 as it offers more IP addresses. As a result, IPV6 solves the issue of running out of unique IP addresses. An IPV6 address looks something lượt thích the following:
3001:0db7:3c5d:0024:0000:0000:1a2f:3c1b
A colon separates each field in an IPV6 address.
Use of AAAA record
Usage of the AAAA record for DNS resolution has great potential because it uses IPV6, which is an improvement over IPV4. Also, as the mạng internet keeps growing and we're running out of IPV4 addresses, the potential for AAAA records is high.
AAAA records are used vĩ đại resolve a tên miền name vĩ đại the newer IPV6 protocol address.
3. CNAME record
CNAME—or, in full, "canonical name"—is a DNS record that points a tên miền name (an alias) vĩ đại another tên miền. In a CNAME record, the alias doesn't point vĩ đại an IP address. And the tên miền name that the alias points vĩ đại is the canonical name. For example, the subdomain ng.example.com can point vĩ đại example.com using CNAME. Here example.com points vĩ đại the actual IP address using an A record.
Use of CNAME record
A practical example for the use of CNAME records is running multiple subdomains for different purposes on the same server. For example, we can use ftp.example.com for tệp tin transfer protocol (FTP) and serve webpages via www.example.com. We can then use a CNAME record vĩ đại point both subdomains vĩ đại example.com. The main tên miền example.com then points vĩ đại the server's IP address using an A record.
It's also possible vĩ đại point a CNAME vĩ đại another CNAME. However, doing ví is inefficient and can lead vĩ đại slow load tốc độ and poor user experience.
4. NS record
A nameserver (NS) record specifies the authoritative DNS server for a tên miền. In other words, the NS record helps point vĩ đại where mạng internet applications lượt thích a trang web browser can find the IP address for a tên miền name. Usually, multiple nameservers are specified for a tên miền. For example, these could look lượt thích ns1.examplehostingprovider.com and ns2.examplehostingprovider.com.
Use of NS record
If you've purchased a trang web hosting service or mix up a simple trang web, you probably received an tin nhắn with nameserver details. Those nameservers, in simple terms, connect your tên miền name vĩ đại the actual server your site is hosted on. The nameserver contains other DNS records for the tên miền lượt thích an A record and MX record.
5. MX record
A mail exchange (MX) record, is a DNS record type that shows where emails for a tên miền should be routed vĩ đại. In other words, an MX record makes it possible vĩ đại direct emails vĩ đại a mail server.
You can have multiple MX records for a single tên miền name. And what this means is that you can have backup tin nhắn servers. The following shows an example of a tên miền with multiple MX records:
Name | Type | Priority | RDATA |
---|---|---|---|
@ | MX | 10 | mx.zoho.com |
@ | MX | 20 | mx2.zoho.com |
From the above table, the MX record with priority 10 will be the primary mail server, while the secondary server will only be used when the primary server is unavailable (or fails vĩ đại send emails). The lower the priority value, the higher the actual priority.
Use of MX record
With an MX record, it's possible vĩ đại hand off emails vĩ đại a dedicated tin nhắn server. For example, you can decide vĩ đại leave all the trouble of setting up webmail on a server you own vĩ đại a specialized tin nhắn provider. This comes with many benefits, including custom tin nhắn clients for reading and sending emails, and improved security and spam filters. Also, you can use a service lượt thích Site24x7 vĩ đại monitor and verify issues with the mail server your MX records point vĩ đại.
Other DNS record types
In addition vĩ đại the five DNS record types covered ví far, here are some other record types:
- SOA record: SOA stands for "start of authority." It's an important DNS record type that stores admin information about a tên miền. This information includes the tin nhắn address of the admin and when the tên miền was last updated.
- TXT record: TXT stands for "text," and this record type lets the owner of a tên miền store text values in the DNS. Several services use this record vĩ đại verify ownership of a tên miền.
- PTR record: A pointer (PTR) record provides a tên miền name for reverse lookup. It's the opposite of an A record as it provides the tên miền name linked vĩ đại an IP address instead of the IP address for a tên miền.
- SRV record: Using this DNS record type, it's possible vĩ đại store the IP address and port for specific services.
- CERT record: This record type stores public keys certificates.
- DCHID: This DNS record type stores information related vĩ đại dynamic host configuration protocol (DHCP).
- DNAME: The full meaning of DNAME is "delegation name." This record type works very similarly vĩ đại CNAME; however, it points all the subdomains for the alias vĩ đại the canonical tên miền name. That is, pointing the DNAME for secondsite.com vĩ đại example.com will also apply vĩ đại staff.secondsite.com and any other subdomain.
Conclusion
In this post, we learned what DNS record types are. We also defined several DNS record types and saw examples of what each type is used for.
DNS makes it possible for us vĩ đại use human-readable tên miền names vĩ đại access resources on the mạng internet. DNS records and the various record types are an important part of the tên miền name system.
Author Bio
This post was written by Pius Aboyi. Pius is a mobile and trang web developer with over 4 years of experience building for the Android platform. He writes code in Java, Kotlin, and PHP. He loves writing about tech and creating how-to tutorials for developers.
Was this article helpful?
Sorry vĩ đại hear that. Let us know how we can improve the article.