The answer is to use Elastic IP Address, If your instance(the one you want to point your naked domain like example.com to) is already assigned an Elastic IP address, just update your domain’s A record to point it to this IP address. If you dont have an elastic ip address mapped to your instance, then you can follow check the AWS documentation on how to do assign an Elastic IP address to your instance.
What is Naked domain ?
Naked domain is the domain name with out the www subdomain that is example.com instead of http://www.example.com, this is usually helpful when a website administrator want to give the users the flexibility to visit their website without typing the www.
There are many websites that does this, and this can be achieved either by pointing the A record directly to the IP address where the website is hosted or using a placeholder IP and redirecting all the web request to the www url.
Drawbacks of pointing naked domains to a web application
- Pointing your domain name to a web application is known to cause issues with SMTP servers and may impact mail delivery for that domain name.
- Hard coding an IP address to your website address also might not be scalable.