Using 2 different IP addresses for same domain name and it's subdomains

I need your help with the following scenario as I tried a lot to make it work but always getting issues:

  • I have 1 main domain name for example called (mydomain)
  • I have 30 subdomains for example called (test1.mydomain, test2.mydomain, … etc)
  • I have two dedicated servers with different IP addresses for example
    server1 IP = 111.111.111.111
    server2 IP = 222.222.222.222

The case now on server1 I’m putting many web applications using my subdomains and not the main domain name and this is working perfectly as I have A record pointing to server1 IP = 111.111.111.111 and the remaining CNAM records for my subdomains.

Now I want to use server2 and add only my website and link directly to my domain name (mydomain) using its IP so server2 IP = 222.222.222.222.

I tried to create another A record so I have an A record for server1 IP and another A record for server2 IP but everything stops working or if I disabled the SSL all subdomains point to the wrong server.

How should I set the DNS records correctly so no issues at all? or any other recommendations?

Thanks in advance

You cannot make the same A record name that you would have for CNAME or vice versa.

You can see this described in more detail in the link below:

Thanks a lot for your reply but how to handle such a scenario or case? any workaround?

Review your existing DNS records to find the matching value in the Name field. Then, decide whether you want to keep the current record or delete it and make a new one.

CNAME records are the only IP resolution record with this type of limitation. You can have more than one A/AAAA record per hostname, which is a way some domains do simple load balancing for incoming requests.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.