How to transfer your website from shared hosting to VPS or dedicated server
Petr Sejba
·
3 min

If you have a website, you might have heard about something called a CNAME record. But what is it, and how does it work? Let's break it down.
A CNAME record is a type of DNS record that allows you to associate one domain name with another. DNS stands for Domain Name System, and it's what helps the internet connect users with websites using easy-to-remember domain names instead of IP addresses.
In a way, a CNAME record acts like a shortcut or an alias for a domain name. It's similar to the way you might create a shortcut on your computer desktop to quickly access a frequently used program or file.
For example, let's say you have a website that you've hosted on a server, and the domain name associated with it is "example.com". However, you also want to create a subdomain called "blog.example.com" and have it point to a different server or hosting provider. You can create a CNAME record that associates "blog.example.com" with the IP address or domain name of the new server, and anyone who types in "blog.example.com" in their browser will be redirected to the new server.
When you create a CNAME record, you're essentially telling the DNS resolver to associate a domain name with another domain name. The CNAME record maps one domain name to another, which means that when someone types in the first domain name, their device or computer will look up the IP address associated with the second domain name and then connect to the server hosting that website.
For instance, let's say you have a website hosted on a server with the IP address 192.168.0.1, and the domain name associated with it is "example.com". You also have a subdomain called "blog.example.com" that you want to redirect to a different server with the IP address 192.168.0.2. You can create a CNAME record that associates "blog.example.com" with the domain name of the new server, such as "newserver.com".
When someone types in "blog.example.com" in their browser, their device or computer will first look up the IP address associated with "blog.example.com". Since "blog.example.com" is a CNAME record, it will then look up the IP address associated with "newserver.com" and connect to the server with that IP address. This server will then send back the webpage that the user requested.
There are several reasons why you might use a CNAME record:
CNAME records can impact website performance because they add an extra step in the DNS lookup process. When a user types in a domain name with a CNAME record, the DNS server has to look up the CNAME record and then look up the domain name specified in the record. This can cause a delay in website loading times, especially if there are multiple CNAME records involved.
The delay in website loading times can be further exacerbated if the DNS server is located far from the user. The longer the distance between the user and the DNS server, the longer the DNS lookup time will be. This is because the DNS query has to travel across multiple networks to reach the DNS server, and each network has its own latency and potential for congestion.
Website owners can mitigate the impact of CNAME records on website performance by minimizing the number of CNAME records used on their website. They can also use a DNS provider that has multiple DNS servers located in different regions to reduce the distance between the user and the DNS server. Additionally, website owners can use a CDN (Content Delivery Network) to cache static content and reduce the number of DNS lookups required for each page load.
CNAME records can also impact SEO (Search Engine Optimization) because they can cause duplicate content issues. If a website has multiple domain names that map to the same content through CNAME records, search engines may consider this as duplicate content and penalize the website for it.
For example, if a website has the domain names www.mywebsite.com and blog.mywebsite.com, and blog.mywebsite.com maps to www.mywebsite.com through a CNAME record, search engines may see this as duplicate content and penalize the website for it. To avoid this issue, website owners should use 301 redirects instead of CNAME records to redirect users to a different domain name or use canonical tags to specify the preferred domain name for search engines.
Transferring CNAME records between DNS providers is usually a straightforward process. Here are the general steps:
It's important to note that the process of transferring CNAME records may differ slightly depending on your DNS provider. Some providers may have different control panel layouts or may use different terminology for their DNS settings.
Additionally, it's important to make sure that you have all of your CNAME records transferred to your new DNS provider. If you have multiple CNAME records, make sure you transfer them all to avoid any potential issues.
If you are not comfortable transferring your CNAME records yourself, many DNS providers offer migration services that can help you transfer your records for you. These services can be especially helpful if you have a large number of records or if you are not familiar with the technical details of DNS.
When transferring CNAME records between DNS providers, there are some best practices that you should follow to ensure a smooth transfer:
Before making any changes to your DNS settings, it's a good idea to create a backup of your current records. This will allow you to restore your settings if anything goes wrong during the transfer process. Most DNS providers have an option to export your DNS records as a file, which you can then save as a backup.
TTL (Time to Live) is the amount of time that DNS servers will cache your DNS records before checking for updated information. By reducing your TTL to a low value (such as 300 seconds), you can help ensure that any changes you make to your DNS records propagate quickly. This will help minimize downtime for your website during the transfer process.
Before you transfer your CNAME records, it's a good idea to test your website to make sure it's working properly. This will help you identify any issues that may exist before you make any changes. After the transfer, you should test your website again to ensure that everything is working as expected.
While your DNS records are propagating, it's important not to make any changes to your DNS settings. This can cause inconsistencies and make it more difficult to troubleshoot any issues that may arise.
After the transfer is complete, it's a good idea to monitor your DNS settings for a few days to ensure that everything is working properly. This will help you identify any issues that may arise and allow you to quickly address them.
Here are some advanced techniques for using CNAME records:
Load balancing is a technique that distributes traffic across multiple servers, which helps to improve website performance and reduce downtime. By using CNAME records to distribute traffic across multiple servers, you can ensure that your website remains up and running even if one server goes down.
When using load balancing with CNAME records, you simply create multiple CNAME records that point to different servers. When a user requests your website, their request is routed to one of the servers specified in the CNAME record. This helps to distribute the load across multiple servers, which helps to improve website performance and reduce downtime.
Load balancing is especially useful for websites that receive a large amount of traffic. By distributing the load across multiple servers, you can ensure that your website remains fast and responsive, even during times of high traffic.
You can use CNAME records to map subdomains to different servers or services. For example, you can map blog.example.com to a blogging service like WordPress or Medium, while keeping the rest of your website hosted on a different server. This can help you use specialized services while still keeping your website cohesive.
Subdomain mapping is useful when you want to use a different server or service for a specific part of your website. For example, you might use a specialized service for your blog, or you might want to host your email on a different server. By using CNAME records to map specific subdomains to different servers or services, you can achieve this without affecting the rest of your website.
To map a subdomain to a different server or service using a CNAME record, simply create a new CNAME record that points to the server or service you want to use. For example, to map blog.example.com to WordPress, you would create a CNAME record with the name "blog" and the value "wordpress.com".
Domain aliasing is another technique that can be used with CNAME records. With domain aliasing, you can use multiple domain names to point to the same website content. This is useful if you have multiple domain names that you want to use for marketing or branding purposes, or if you want to redirect traffic from an old domain name to a new one.
To create a domain alias using CNAME records, simply create a new CNAME record with the name of the domain you want to alias and the value of the canonical domain name. For example, to alias www.example.net to www.example.com, you would create a CNAME record with the name "www.example.net" and the value "www.example.com".
Domain aliasing can be especially useful for businesses that have multiple brands or products. By using different domain names for each brand or product, you can create a cohesive marketing strategy while still using the same website content.
In summary, a CNAME record is a type of DNS record that allows you to associate one domain name with another. It acts like a shortcut or an alias for a domain name and allows you to redirect subdomains, create custom URLs, load balance traffic, and migrate websites. By understanding how CNAME records work, you can make the most of your domain name and ensure that your website is accessible and reliable for your users.
Experience the speed of MarbleHost for 30 days, completely on us. Get full access to NVMe storage and 24/7 support. No credit card required, no strings attached.
Activation takes less than 2 minutes.