I want to correctly Set up my own email server at home for my domain.com. It is hosted by namecheap.
I need to set up the following
On Namecheap (Domain provider):
MX Record
Subdomain
On Server:
Dynamic DNS entry for Subdomain
/etc/hosts
/etc/hostname
This is what I'm confused about
/etc/hostname
domain.com
OR
/etc/hostname
mail.domain.com
For Hosts
/etc/hosts
127.0.0.1 localhost
192.168.1.42 mail.freesoftwareservers.com mail
OR
127.0.0.1 localhost
127.0.1.1 mail.freesoftwareservers.com mail
OR
127.0.0.1 localhost
Public IP mail.freesoftwareservers.com mail
OR something else lol
This is a standard set up, with public DNS pointing to my router, and internal DNS/port forward to my Server, with a static IP.