Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set a url to my EC2 instance instead of the IP?

I am working on an AWS EC2 instance, I installed an apache server. Is it possible to set a url to my server?

I would like to write on my browser:

http://myServiceWebSite

instead of

http://23.26.31.178

Can I hide the ip of my server by a face name? Thank you.

like image 321
Rami Avatar asked Aug 29 '12 11:08

Rami


People also ask

How do I get my AWS EC2 URL?

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances and select your instance. The following information is available on the Networking tab: Public IPv4 address — The public IPv4 address.

Can I connect to EC2 without public IP?

To connect using the Amazon EC2 console, the instance must have a public IPv4 address. If the instance does not have a public IP address, you can connect to the instance over a private network using an SSH client or the EC2 Instance Connect CLI.


2 Answers

You can set a DNS using a domain registrar such as Go Daddy
You can use FREE domain names such as co.nr though I think that 13$ a year for a .com is a descent price.

As ajay wrote, Amazon Does provide a default DNS but it is "ugly" and you will probably not use it.

like image 55
Chen Harel Avatar answered Sep 22 '22 19:09

Chen Harel


By default, every time you restart a machine it will probably assign a different IP address, and the DNS name is ugly because it is based on IP, and it is released on instance shutdown.

If your server is used by the public internet you might have at least 3 choices:

  1. Make the IP address static by using Elastic IP option from EC2 console and register this IP using some DNS Service such as Go Daddy.
  2. Leave your IP assigned dynamically and use a dynamic DNS service such as DynDns.
  3. If need to use an Elastic Load Balancer use the AWS Route 53 DNS Service, and instead of creating an A Resource Record pointing to a static IP address, you could use an Alias Resource Record pointing to your Elastic Load Balancer, I think this would be the best option if you have more than 1 server.
like image 29
Alessandro Oliveira Avatar answered Sep 21 '22 19:09

Alessandro Oliveira