apex, bare domain ( domain without www) and www.domain.com should point to the same IP. In amazon load balance or some of the cloud solution, they do not provide us a static IP, they provide us a name and asks us to point our domain to their domain. There is no problem with www.domain.com , but we can’t point apex domain (domain.com) to a cname record, it ‘s because the current DNS RFC does not allow this.

There are many dns hosting providers customized their DNS to support this feature. If you are using Route53, you can use the script below to monitor the difference between the 2 records, if it see a difference , it will update the record automatically.

This use boto library.

You also need to update your aws credentials in .aws folder.