Hamdallah Fatayer
Hamdallah Fatayer

Reputation: 1

aws ec2 instance dns public name change

how to change this

http://ec2-3-135-20-94.us-east-2.compute.amazonaws.com/

to this

http://myname.us-east-2.compute.amazonaws.com/

I tried checking the vpc options but couldnt figure out where to go to change the auto-generated public dns

Upvotes: 0

Views: 1172

Answers (2)

John Rotenstein
John Rotenstein

Reputation: 270144

You cannot use a domain name of myname.us-east-2.compute.amazonaws.com because the amazonaws.com domain belongs to Amazon.

However, you could purchase your own domain and use it to access your instance, such as: www.hamdallah.com

This would involve:

  • Assigning a static Elastic IP address to the instance (so that the IP address does not change)
  • Purchasing a domain name
  • Creating an A-Record in the DNS system to point your desired domain name to the Elastic IP address

For details, see: Routing traffic to an Amazon EC2 instance - Amazon Route 53

Upvotes: 1

samtoddler
samtoddler

Reputation: 9665

As per the documentation

A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.com for the us-east-1 Region, and ec2-public-ipv4-address.region.compute.amazonaws.com for other Region.

As far as DHCP options sets concerned

domain-name:

The domain name for your instances. You can specify a custom domain name (for example, example.com). This value is used to complete unqualified DNS hostnames. If you specify a custom domain name, you must set domain-name-servers to a custom DNS server

In both cases, you can't change the name you are trying to use.

If you really want to have a different DNS name for the ec2 instance, look into route53

Upvotes: 0

Related Questions