-1

I have loadbalancer sitting infront of serveral webservers.

The website served up has a contact form that uses sendmail.

I have installed sendmail on one of these webservers: web-01 This is the hostname of the machine.

I have gone into the /etc/hosts file and added the following:

127.0.0.1 example.com web-01

At this point the form is sending correctly from this machine.

Now, I want to create an image of this server, so I can create new servers from the image and place them behind the loadbalancer.

The problem is, when I create web-02 from the web-01-image the /etc/hosts file still contains:

127.0.0.1 example.com web-01

There is no alias mapping web-02 to example.com and sendmail does not have a valid FQDN. At this point I need to edit the /etc/hosts file every time I create a new server.

Is there a better approach to this?

1 Answers1

0

Use MASQUERADE_AS in sendmail.mc.

See file cf/README in sendmail distribution, section MASQUERADING AND RELAYING

AnFi
  • 6,103
  • 1
  • 14
  • 27