Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set IP address as CNAME record for subdomain

Tags:

ip

hosting

cname

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?

like image 933
Ali Avatar asked Dec 04 '22 16:12

Ali


1 Answers

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.

like image 76
Rahif Abboud Avatar answered Dec 07 '22 04:12

Rahif Abboud