How to set IP address as CNAME record for subdomain

Ali picture Ali · May 10, 2012 · Viewed 14k times · Source

I've got an Amazon elastic IP. I've a subdomain like aap.myhosting.com and I wanna associate this IP address with 'app' sub domain. But when I change the CNAME and put the IP address as HOST for the subdomain 'app' I get the following error.

Please use only letters, numbers, dashes (-) or periods (.) followed by the appropriate web extension such as .com, .net, .org. Do not enter spaces or other punctuation. (example: abc-company.com)

The error is self explanatory but is there anyway I can set this IP as host for sub-domain?

Answer

Rahif Abboud picture Rahif Abboud · May 10, 2012

CNAME is not designed to point a sub-domain to an IP address. You have to use the A record. If the sub-domain is already in the CNAME, then you have to delete it and then add it as an A record pointing to the IP address you want.