Mail cname
A CNAME
record!
A CNAME
(Canonical Name Record) is a type of DNS record that maps an alias or a nickname to the canonical name of a server or a domain. In other words, it's a way to create an alias for a domain or a server, so that when someone requests the alias, the DNS server returns the IP address of the canonical name.
Here's the syntax:
CNAME <alias> <canonical name>
Where:
<alias>
is the alias or nickname you want to create.<canonical name>
is the actual domain name or server name that the alias points to.
For example:
CNAME www.example.com example.com
This CNAME
record says that when someone requests www.example.com
, the DNS server should return the IP address of example.com
.
CNAME
records are commonly used for:
- Subdomains: To create a subdomain that points to the same IP address as the parent domain.
- Load balancing: To distribute traffic across multiple servers by creating multiple
CNAME
records that point to different servers. - Content delivery networks (CDNs): To cache content at multiple locations by creating
CNAME
records that point to different CDN servers. - Email services: To route email traffic to a specific server or service.
When a DNS query is made for a CNAME
record, the DNS server returns the canonical name instead of the IP address. The client then makes a new DNS query for the canonical name, which returns the IP address. This process is called a "chain of lookups".
CNAME
records are an essential part of the DNS system, allowing for flexible and scalable domain name management.