What’s a canonical name?

Print anything with Printful



A canonical name (CNAME) is used in computer networking to identify a computer’s actual name within the Internet naming system. CNAME records in the domain name system (DNS) allow aliases to point to the real computer name. DNS performs a second lookup of the canonical name to resolve its IP address on the network. However, there are limitations to its use, such as the possibility of creating an infinite loop.

A canonical name is a term used in computer networking to identify the actual name of a computer within the Internet naming system. It is most often used in reference to a resource record in the domain name system (DNS), which is responsible for translating obscure Internet Protocol (IP) addresses into more recognizable names. In this case, the resource record in the DNS is called the CNAME and allows another name, or alias, to point to the real computer name.

When a computer looks up a website, for example, it checks the name typed into the web browser against special servers that host DNS records. If the name looked up in DNS records is specified in a CNAME record, it receives the canonical name, then performs a second lookup on the canonical name to resolve the IP address of the host computer. A fairly common example is when a single computer hosts multiple services, such as a website and a File Transfer Protocol (FTP) service for transferring data.

In a web browser, a user can type www.example.com. During the DNS lookup, it encounters the canonical name in a CNAME record pointing to a server named foo.example.com. Another user could then use an FTP client and type the FTP server address at ftp.example.com. The DNS lookup encounters another CNAME entry that also points to foo.example.com, the same host computer used for the website. In this case, however, the DNS was given two different names, which resulted in the canonical name of the server.

In both of the above cases, DNS then performs a second lookup of the canonical name to resolve its IP address on the network. The IP address is then sent back to the computer making the Web or FTP request so that data packets can start flowing. Naturally, this opens up possibilities for network administrators to use DNS CNAME records in other ways. Another common technique used by website hosting services allows a single host computer to run several web servers, each with a different name.

However, due to the sensitive nature of DNS, implementing canonical names with CNAME records has several dangers, and therefore there are limitations to its use. The most dangerous is the possibility of creating an infinite loop when looking up a name, so no CNAME record should point to another CNAME record. For example, if two CNAME records are used, where www.example.com points to the canonical name foo.example.com and then foo.example.com points to www.example.com, the search will endlessly check a name against the other.




Protect your devices with Threat Protection by NordVPN


Skip to content