# Multiple IPs on one machine



## Nevering (Aug 14, 2013)

I'm setting up a Postfix mail server and rather new to freebsd FreeBSD. I would appreciate some help in adding public IP's to the appropriate configuration files and for Postfix/Dovecot. 

Thanks.


----------



## SirDice (Aug 14, 2013)

It's all done in /etc/rc.conf. For a re(4) network card it will look something like this:

```
ifconfig_re0="inet 1.2.3.4 netmask 255.255.255.0"
ifconfig_re0_alias0="inet 2.3.4.5 netmask 255.255.255.255"
ifconfig_re0_alias1="inet 3.4.5.6 netmask 255.255.255.255"
```


----------



## Nevering (Aug 14, 2013)

That's it, the host names don't need to go anywhere. Somewhere I heard that hosts.conf needs to be updated. Also, there are some Postfix entries and Dovecot right?


----------



## SirDice (Aug 15, 2013)

A system can only have one hostname. You probably mean /etc/hosts. See hosts(5).


----------



## Nevering (Aug 15, 2013)

Is there any consolidated documentation on how to do this? I keep finding bits and pieces and most is for virtual domains.


----------



## junovitch@ (Aug 15, 2013)

This is going to depend on your local network.  The /etc/hosts file is only consulted on the one system.  You'll have to put you appropriate MX records into your DNS server so that it gets referenced from the outside properly.  As far as if Postfix or Dovecot need them hard coded, I've never worked with them so can't answer that.


----------



## Nevering (Aug 15, 2013)

DNS is easy for me to setup set up, as I'm familiar with that. It's the Postfix/Dovecot/Amavis/etc. that is kind of mind numbing.


----------



## da1 (Aug 16, 2013)

Does this help -> https://sites.google.com/site/ghidit/how-to-2/freebsd-9-mail-server-setup-postfix-dovecot-2-virtual-users-mysql-sasl-postfixadmin-and-others?


----------

