Learnings on DNS§
Written by Jayesh Bhoot Published on
Syntax of a DNS record, along with examples:
Here, foo.example.com
resolves to example.com
, which in turn resolves to
1.2.3.4
.
In a CNAME mapping, @ CNAME example.com
, example.com is the canonical name, while @
is the
domain being mapped to the canonical name.
In a record, @
means the current origin. Usually, the current origin means the apex domain (like
bhoot.sh).
In a record, www
implies the www subdomain of the current origin. e.g., www.bhoot.sh.
Prefer ANAME to CNAME even if the the former is not yet standardized because CNAME does not allow multiple records for the same canonical name. Also, CNAME does not allow mapping the apex domain to a canonical name.
Ideally, several domain names map to a canoical name via CNAME/ANAME records. This canonical name is then mapped to the actual IP address in an A record.