CNAME record
CNAME Record[edit | edit source]
A CNAME record (Canonical Name record) is a type of DNS record used in the Domain Name System (DNS) to map one domain name to another. It is commonly used when a website or service needs to be accessed using multiple domain names.
Syntax[edit | edit source]
The syntax for creating a CNAME record is as follows:
``` example.com. IN CNAME targetdomain.com. ```
In this syntax, example.com is the domain name for which the CNAME record is being created, and targetdomain.com is the domain name to which it is being mapped. The IN keyword indicates the Internet class.
Purpose[edit | edit source]
The main purpose of a CNAME record is to create an alias for a domain name. It allows a domain name to be associated with another domain name, which can be useful in various scenarios. For example, if a website needs to be accessible using both www.example.com and example.com, a CNAME record can be used to map www.example.com to example.com.
Usage[edit | edit source]
CNAME records are commonly used in the following scenarios:
1. Subdomains: CNAME records can be used to create subdomains that point to another domain or hostname. For example, a CNAME record can be created to map blog.example.com to www.example.com.
2. Load Balancing: CNAME records can be used to distribute traffic across multiple servers or load balancers. By creating multiple CNAME records pointing to different IP addresses, traffic can be evenly distributed among the servers.
3. Domain Name Changes: CNAME records can be used during domain name changes or migrations. Instead of updating all the references to the old domain name, a CNAME record can be created to point the old domain name to the new one.
Limitations[edit | edit source]
There are a few limitations to keep in mind when using CNAME records:
1. Apex Domain: CNAME records cannot be used for the apex domain (root domain) itself. For example, you cannot create a CNAME record for example.com, but you can create it for www.example.com.
2. Other Record Types: CNAME records cannot coexist with other record types for the same domain name. For example, you cannot have a CNAME record and an A record for the same domain name.
3. TTL: The Time-to-Live (TTL) value for a CNAME record affects the caching behavior of DNS resolvers. It is important to set an appropriate TTL value to ensure timely updates.
See Also[edit | edit source]
References[edit | edit source]
Search WikiMD
Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro / Zepbound) available.
Advertise on WikiMD
WikiMD's Wellness Encyclopedia |
Let Food Be Thy Medicine Medicine Thy Food - Hippocrates |
Translate this page: - East Asian
中文,
日本,
한국어,
South Asian
हिन्दी,
தமிழ்,
తెలుగు,
Urdu,
ಕನ್ನಡ,
Southeast Asian
Indonesian,
Vietnamese,
Thai,
မြန်မာဘာသာ,
বাংলা
European
español,
Deutsch,
français,
Greek,
português do Brasil,
polski,
română,
русский,
Nederlands,
norsk,
svenska,
suomi,
Italian
Middle Eastern & African
عربى,
Turkish,
Persian,
Hebrew,
Afrikaans,
isiZulu,
Kiswahili,
Other
Bulgarian,
Hungarian,
Czech,
Swedish,
മലയാളം,
मराठी,
ਪੰਜਾਬੀ,
ગુજરાતી,
Portuguese,
Ukrainian
Medical Disclaimer: WikiMD is not a substitute for professional medical advice. The information on WikiMD is provided as an information resource only, may be incorrect, outdated or misleading, and is not to be used or relied on for any diagnostic or treatment purposes. Please consult your health care provider before making any healthcare decisions or for guidance about a specific medical condition. WikiMD expressly disclaims responsibility, and shall have no liability, for any damages, loss, injury, or liability whatsoever suffered as a result of your reliance on the information contained in this site. By visiting this site you agree to the foregoing terms and conditions, which may from time to time be changed or supplemented by WikiMD. If you do not agree to the foregoing terms and conditions, you should not enter or use this site. See full disclaimer.
Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.
Contributors: Prab R. Tumpati, MD