Clicky

I have a linux server running on Amazon's EC2. It is unable to resolve it's own host IP address. It has a static IP assigned in a VPC. When I type "hostname" it resolves the name, but "hostname -i" yields unknown host. This is causing some problems for some software.

ifconfig shows the correct IP address and the server is clearly passing traffic to the outside because I can connect to it. I believe I have allowed all traffic through firewalls in an attempt to troubleshoot this.

This server was copied to a VPC from a non VPC instance (this might have something to do with the problem / maybe a config file that needs to be changed, etc).

asked 10/21/2011 06:50

aseisman's gravatar image

aseisman ♦♦


7 Answers:
you have to setup these values in the /etc/hosts file.


Make sure the entry exists in /etc/hosts file
Suppose IP address is
192.168.0.1           name         alias
link

answered

farzanj's gravatar image

farzanj

This is what I put in my hosts file but it does not work. Previously the IP had been 127.0.0.1

10.0.4.10 localhost localhost.localdomain
link

answered 2011-10-21 at 04:34:31

aseisman's gravatar image

aseisman

NO.

Leave that entry alone
127.0.0.1 localhost localhost.localdomain

PUT
10.0.4.10 nameYouWant myHostName.domain.com
link

answered 2011-10-21 at 04:49:36

farzanj's gravatar image

farzanj

Still not working:

127.0.0.1 localhost localhost.localdomain
10.0.4.10 name name.domain.com
link

answered 2011-10-21 at 04:54:13

aseisman's gravatar image

aseisman

What does the command do:

host name             (Where name is the name in the /etc/hosts file)
link

answered 2011-10-21 at 04:57:12

farzanj's gravatar image

farzanj

This worked, I needed to assign the hostname to the new hosts entry. Thank you for you quick responses and helpful insight.
link

answered 2011-10-21 at 05:00:59

aseisman's gravatar image

aseisman

Glad it did.  Actually the other command is querying the DNS and you don't have the DNS set up.
link

answered 2011-10-21 at 07:01:58

farzanj's gravatar image

farzanj

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×2
×3
×2
×2
×118
×59

Asked: 10/21/2011 06:50

Seen: 646 times

Last updated: 10/21/2011 03:03