Jeevan Dongre
Jeevan Dongre

Reputation: 4649

public ip of the ec2 instances redirecting to private ip

I am setting up chef-server on ec2 ubuntu instance. After installing the chef on the ec2 13.04 instance, and I have attached the elastic Ip address to it and mapped a domain to the ip in the godaddy. Whenever I hit chef.myserver.com it redirects me to the private ip of the aws ec2 instance. Also I am whenever I try to hit chef.myserver.com:4040 to access the web_ui it redirects me to the same private ip of the instances. A quick googling showed some thing about FQDN, but I am not to figure out how do I set it up in the ec2 instance. Kindly help me out.

Upvotes: 0

Views: 1226

Answers (1)

Devin
Devin

Reputation: 96

The EC2 instance is provided a public dns entry that looks something like ec2-xxx-xxx-xxx.xxx.us-west-2.compute.amazonaws.com. If you use this public domain name from an EC2 instance your private IP is returned and not the public IP. From outside AWS, the EC2-generated domain name will return the true public IP.

If you put the public IP into godaddy dns, I don't see how it could possibly know the private IP. If you put in 1.2.3.4 for chef.myserver.com then 1.2.3.4 will be returned. If you cnamed godaddy to your ec2-generated dns, change it to an A record and put in the actual elastic IP address.

Upvotes: 1

Related Questions