2

Is it possible to set the fully qualified domain name from a bash script?

I am using Ubuntu 12.04 LTS. I have an autoscaling group on Amazon and I am using Puppet for configuration.

For example, I would like to use admin.staging.mycompany.net as a FQDN for all instances in the autoscaling group. I can run a bash script when the autoscaling group fires new instances.

Since Puppet uses the fully qualified domain name to figure out which manifest to apply, I need to come up with a way to set a new EC2 instance's FQDN from a bash script, so the autoscaling group can fire up a new instance and apply the correct Puppet manifest.

I don't want to ssh to instances and manually change /etc/hosts and /etc/hostname as that would defeat the point of the autoscaling group.

Richard Knop
  • 193
  • 1
  • 2
  • 6
  • 2
    Possible duplicate of [How do I change the hostname without a restart?](http://askubuntu.com/questions/87665/how-do-i-change-the-hostname-without-a-restart) – muru Jun 05 '16 at 21:17

0 Answers0