/etc/hosts file for a multi-homed, multi-domain machine?

Posted by threecheeseopera on Server Fault See other posts from Server Fault or by threecheeseopera
Published on 2010-06-16T16:44:13Z Indexed on 2010/06/16 16:53 UTC
Read the original article Hit count: 177

Filed under:
|

I have a server (debian) with two network interfaces that I would like to host multiple services and domains on; it is not entirely clear to me how the hosts file should be set up. Example:

eth0, bound to WAN interface 1.2.3.4:
   mail.example.com
   www.example.com
eth0:1, bound to WAN interface 1.2.3.5:
   www.other-domain.com
eth1, bound to LAN 192.168.1.123:
   some-clever-hostname

What should my hosts file look like? (including localhost,localhost.localdomain, etc.) Should I use DNS for some of these entries? Which ones?

Thanks!

© Server Fault or respective owner

Related posts about networking

Related posts about hosts-file