+2 votes
in Web & Google by (11k points)

My website is hosted on a VPS located in NY, USA. I have several thousands of images on my server that are parts of the webpages. Currently all the images are served from a subdomain (images.mywebsite.com) that is also present on the same server. To minimize the server load, I want to host subdomain on a different host. What are steps to point subdomain to another host?

1 Answer

0 votes
by (15.1k points)

If your server is too busy, it's always a good idea to move the heavy contents like images to another host. Most importantly, if possible, move your images closer to the location you get most of the traffics from. Suppose the majority of your traffic is from India, then host images on some Indian server or Singapore server or EU server (this should be the last option). Nowadays, Google is behaving like a cop. If it finds that your website is not opening in less than 6-7 seconds, your website will be penalized. Now, coming to the question, here are the steps to point your subdomain (e.g images.example.com) to another server:

You need 3 things to accomplish the task - 1. domain registrar userid/password, 2. userid/password for the current server, and 3. userid/password for the new server where you want to host images.

Step 1: Log in to your account at domain registrar where your domain example.com is registered. Here, you need to add an A record. If you have access to DNS management (different registrar may have different options), add a new A record. You need hostname, IP address, and TTL to create a new A record. Enter hostname = images (subdomain name), IP = IP of the new host, and TTL = 14400 (you can also keep the default value) and submit. You subdomain should be accessible within a few hours depending on DNS propagation time.

Step 2: Log in to your new server. Here, you need to first add domain example.com and then create subdomain images.example.com. All web panels (e.g. Cpanel or centos web panel) have very user-friendly UI to add a domain and subdomain. When you add domain example.com, some hosting company might ask EPP code for the verification. You can get EPP code from your domain registrar.

That's it and now your subdomain images.example.com is pointing to your new host. Log in to your current server, download images, and move them from old server to new server and you are done.

...