Multiple domains on the same sendmail server

The thoughts of running make to compile m4 macros to set up email for multiple domains got you down. Maybe there is an easier way. Read on.

I host this site on a machine generously donated by my good friend Kevin White up at When I purchased and wanted to use email I set up my dns and crossed my fingers. Unfortunately it didn’t work. Here is what I found I had to do to make it work.

The caveat, and this is a biggy, is that this does not automagically give you separate email systems. Sending an email to and is the exact same thing. For our purposes this is fine, but for yours it may not be.

On our particular sendmail setup there is a file named /etc/mail/local-host-names. It contains the names of any hosts that send/receive from a particular machine. By default sendmail also appears to add the primary hostname of the machine. (Thats why works without needing an entry there.) All you have to do is add the names of any servers you are hosting to the local-host-names file. In my case it was

Then simply restart you sendmail service. On RedHat 7.3 the command is

/etc/init.d/sendmail restart

A more ideal setup seems to be significantly more work. Although, as a sendmail newbie, I may be mistaken.

Leave a Reply

Your email address will not be published. Required fields are marked *