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 188.8.131.52 and I want to example.com to be resolved to Google’s IP. so I added:
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?
You’ve entered them in reverse. The IP address must come first, then the host names.
203.0.113.187 example.com www.example.com
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.