I want to add an entry for a website name to be redireected to another website. So I added the entry in the etc/hosts file. For example, let Google's IP is 1.2.3.4 and I want to example.com to be resolved to Google's IP. so I added: example.com 1.2.3.4
But this is totally ignored. When I enter example.com in an updated Chrome browser, the browser goes to example.com and ignores the hosts entry for example.com.
The experiment is successful in my own PC but does not work in my Amazon EC2 instant.
Can you explain why etc/hosts entry is ignored by my Amazon EC2 instant? How to fix this issue please?