I have a simple http service hosted in AWS ec2(linux). It is accessible from the browser using public IP. However, I want to make it accessible using a domain name. I updated the /etc/hosts file with the domain details but unfortunately, it is not working from the browser at all. Below are the relevant details
[ec2-user@ip-172-31-35-217 ~]$ cat /etc/hosts
13.201.125.33 sdg123.int.thrs11.com
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ip-172-31-35-217.ap-south-1.compute.internal
::1 localhost6 localhost6.localdomain6
Here, 13.201.125.33 is the public IP accessible from browser
Ping works fine
[ec2-user@ip-172-31-35-217 ~]$ ping sdg123.int.thrs11.com
PING sdg123.int.thrs11.com (13.201.125.33) 56(84) bytes of data.
64 bytes from sdg123.int.thrs11.com (13.201.125.33): icmp_seq=1 ttl=126 time=0.446 ms
64 bytes from sdg123.int.thrs11.com (13.201.125.33): icmp_seq=2 ttl=126 time=0.366 ms
64 bytes from sdg123.int.thrs11.com (13.201.125.33): icmp_seq=3 ttl=126 time=0.425 ms
64 bytes from sdg123.int.thrs11.com (13.201.125.33): icmp_seq=4 ttl=126 time=0.359 ms
Curl works fine
[ec2-user@ip-172-31-35-217 ~]$ curl http://sdg123.int.thrs11.com
<html><body><h1>It works!</h1></body></html>
Kindly suggest how to get this working from browser with domain : sdg123.int.thrs11.com