www and non-www Different websites and servers

tothy

Newbie
Joined
Sep 25, 2018
Messages
41
Reaction score
23
Hello,

I am trying to host the www and non-www versions of the same domain name as 2 different websites in different servers. Pleace can you guys help me on how to correctly set the A records and CNAME records on the registrar side. Thanks
 
You need to point both A records to the hosting IPs, e.g.

testdomain.com 1.1.1.1
http://www.testdomain.com 1.1.1.2
 
Thank you for your reply. Actually the domain name have the nameservers pointing somewhere already and has a website on it. I want to keep that site to load on non-www et host the www on another server. So do you mean I only need to create an A record for www dot testdomain dot com and point it to the ip of the new server?
 
So you need to create an A record for http://www.domain.com and the IP will be whatever the host you're using.
 
Ok. I will set it up and give a feedback at a later time. Thanks
 
Exactly as @Sephrata mentioned. If you have the site running on server A, and the name servers for the domain pointing to server A, then you just go into the DNS on server A, and you can create an a record as follows -
domain - www.yourdomain.com, value - 1.2.3.4 (Where 1.2.3.4 is the IP address of server B where you want to host the website that is going to appear for www.yourdomain.com).

Also, quite possibly you will currently have a CNAME record on server A that maps www.yourdomain.com to yourdomain.com so you will also need to delete that record first - otherwise you will probably receive an error when you try creating the A record to say there is already an entry for www.
 
Also, I have moved this to the web hosting sub-forum as it is more suited here.
 
You just create www as a subdomain and point it elsewhere.
 
I have set up everything as explained, but the www version is still displaying the non-www site. No other configuration except the A record I have added is present in the DNS manager. The actual nameservers I use are different than the registrar primary nameservers because I hosted the domain on a whitelabel service, but I will like to use the www version for others things. So I don't know if I am getting something wrong, but it looks like that is the reason the www is still displaying the non-www. Please correct me if I am wrong.
 
If you only have 1 A record and nothing else, then the non-www should not be resolving.

Who are you using to manage the DNS?
 
I manage it by myself and I have set only 1 A record for the www
 
I have set up everything as explained, but the www version is still displaying the non-www site. No other configuration except the A record I have added is present in the DNS manager. The actual nameservers I use are different than the registrar primary nameservers because I hosted the domain on a whitelabel service, but I will like to use the www version for others things. So I don't know if I am getting something wrong, but it looks like that is the reason the www is still displaying the non-www. Please correct me if I am wrong.

If your website is pointed on your hosting Nameservers than you need to add and manage DNS entry's from your Hosting Account ( Not your Domain provider account ).
You can not have both Nameservers and custom DNS configured for a domain from your Domain provider.
If you want to use your Domain provider panel than i would suggest for you to remove the Nameservers and add only DNS Records like :

sUnsYTe
 
If your website is pointed on your hosting Nameservers than you need to add and manage DNS entry's from your Hosting Account ( Not your Domain provider account ).
You can not have both Nameservers and custom DNS configured for a domain from your Domain provider.
If you want to use your Domain provider panel than i would suggest for you to remove the Nameservers and add only DNS Records like :

Yeah that's what I though. The domain is hosted on a whitelabel system and I don't have any access to the hosting account. So I will remove the Nameservers and add DNS records as you suggested.

By the way, I was looking for the ip of the hosting and I found that the website is resolving on 4 ips, do I need to add an A records for all those ips?
 
Last edited:
Yeah that's what I though. The domain is hosted on a whitelabel system and I don't have any access to the hosting account. So I will remove the Nameservers and add DNS records as you suggested.

By the way, I was looking for the ip of the hosting and I found that the website is resolving on 4 ips, do I need to add an A records for all those ips?

Ask your hosting provider on what IP is your account. Also you can check your Hosting IP when you log in to your Cpanel on the right sidebar.
 
Ask your hosting provider on what IP is your account. Also you can check your Hosting IP when you log in to your Cpanel on the right sidebar.

I resolved the issue by following your previous recommendations. Now I have the www and non-www resolving on different servers.

Thank you all for your help on this matter.
 
Back
Top