Currently my subdomain is hosted within same webhotel as my main domain. I would like to change it to point another domain (website on Windows Azure). Subdomain should be accessible all the time during transition, from old or new location as long as it is not down.

My webhotel uses DirectAdmin and for subdomain I have A record pointing subdomain to IP address. That A record and subdomain webpage itself was done with "Subdomain Management" tool in DirectAdmin. What is the best way to redirect subdomain to new host? What if I modify .htaccess with redirect to new doamin? Does .htaccess override my A record or would this cause some issues? Any better solutions to transfer the subdomain? Thanks.

  • Why doesn't the A record work? It should
    – Steve
    May 22, 2015 at 5:53
  • @Steve But A record always points to IP address? I want to move subdomain to Windows Azure and I don't have IP address for that.
    – superg
    May 22, 2015 at 7:20
  • You should say that in the question
    – Steve
    May 22, 2015 at 7:25
  • @Steve Sorry about that, my knowledge on this area is very limited. Will edit the question.
    – superg
    May 22, 2015 at 7:28
  • You will need an IP address for your new machine. Is it you just don't have one yet and cannot make set-up changes as a result?? Otherwise, you will need an IP address or a domain name of some sort you can use to point your sub-domain.
    – closetnoc
    May 22, 2015 at 13:52

1 Answer 1


What you are searching for is known as a CNAME record. With Windows Azure you will be given a public URL for the service usually under a domain associated with Azure. From there you change the current A record to a CNAME record with the same sub domain name and simply add the public domain for the Azure service. What will happen then is when a user tries to connect to the sub domain in question they will get back a response saying that it is a CNAME of the Azure domain and will automatically do a DNS lookup on the Azure domain to get the right IP address. The comment made above talking about getting the machines IP address is a bad idea unless you have had a dedicated IP assigned to it as many Azure endpoints have empherial IP's where the IP address can change over time with little or no notice which would break your site each time it happens, whereas by using a CNAME record the end users browser will always get the correct IP address as of that point in time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.