ec2-set-hostname should not put the public hostname in /etc/hosts

Bug #352745 reported by John Hampton
4
Affects Status Importance Assigned to Milestone
Ubuntu on EC2
Fix Committed
Undecided
Unassigned

Bug Description

ec2-set-hostname adds the ec2 public hostname to /etc/hosts resolving to 127.0.1.1. The public hostname can be changed at any time during the lifetime of the instance (associating/detaching elastic IPs for instance). I think it would be better if only the internal host name is added to /etc/hosts as this should remain constant.

Related branches

Revision history for this message
Eric Hammond (esh) wrote :

This makes sense to me, too.

Note that another side effect of the current approach is that "hostname --fqdn" returns the initial external hostname (which, as John points out, may not stay accurate depending on external factors).

Changed in ubuntu-on-ec2:
status: New → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

Fixed for the next release.

Changed in ubuntu-on-ec2:
status: Confirmed → Fix Committed
Revision history for this message
Patrick J. McNerthney (pmcnerthney) wrote :

In addition, could this process establish the name in /etc/hosts on every boot? Right now, it is coded such that it only gets set upon the first boot. What happens in my use case, is that I have created my own AMI from the Ubuntu instance, and when I subsequently launch my own AMI, the /etc/hosts file retains the original set of host names.

Pat McNerthney
ClearPoint Metrics, Inc.

Revision history for this message
Eric Hammond (esh) wrote :

Marking this as a duplicate of #407861 in which I've tried to summarize what I think is the best approach to solving the problems here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.