What are DNS Records
DNS records are akin to names and addresses on the internet. Just as we use addresses when visiting a friend's house, computers and smartphones require information to identify the location of websites and services on the internet. DNS records provide this information that points to such locations.
A Records
A records play the role of converting an internet "name" into an "address". Specifically, the job of an A record is to convert a website's domain name (e.g., www.example.com
) into its actual IP address (e.g., 192.0.2.1
).
Think of it like knowing the name "Tokyo Tower" but not knowing its actual location or address. When you mention "Tokyo Tower," the A record provides the specific address, such as "4-2-8 Shibakoen, Minato-ku, Tokyo."
CNAME Records
CNAME records have the role of "redirecting" one domain name (website name) to another domain name. In other words, they instruct that when a certain name is provided, it should reference a different name.
Differences Between A Records and CNAME Records
Both A records and CNAME records have the function of associating names and addresses on the internet, but they differ in how they're used.
A records directly link a domain name (e.g., www.example.com
) to an IP address (e.g., 192.0.2.1
). It's akin to directly associating a person's name (e.g., Taro Tanaka) with their home address (e.g., 1-1-1 Chuo-ku, Tokyo).
CNAME records redirect one domain name to another domain name. This other domain name eventually references the actual IP address. You can think of it like someone's nickname (e.g., "tanakan") referring to their actual name (e.g., Taro Tanaka). If you know the nickname, you can access the real name and address.
References