0

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.

2
  • Postfix-DoveCot-Spam-Antivuris plus webclient is not an easy thing to set up, but I want to have the correct settings externally and internally before I set up the programs lol, Ive been troubleshooting this for days with incorrect settings in my dynamic dns, i had it as mail.domain.com, now i just want to be 100% on hosts and hostname, and I figured id post a question with all the info needed for others that should be configued before setting up postfix! Jul 25, 2015 at 15:43
  • no thats not my real private IP Jul 28, 2015 at 5:46

1 Answer 1

1

This is only a partial answer for NameCheap (Domain) settings, I just wanted to post the whole set up in one question for the public, I need help with correct (Server) etc/hosts & etc/hostname.

I know that this question is all over the internet, but I could not find simple answers, hopefully this post will help others including me!

MX Record is as follows

HOSTNAME MAILSERVER-HOSTNAME MAILTYPE MX-PREF TTL

@           mail.domain.com                MX       10      180

Subdomain

HOSTNAME IP Address/URL Record Type MX-PREF TTL

mail        127.0.0.1      A(Address)     n/a      180     

(Set record to loopback to test dynamic DNS, it should update to public IP)

Dynamic DNS Entry

So I use a Python script, but in general The point I want to make is that the hosts has changed from @ to simply mail or whatever the subdomain is.

IE: For my domain this is my script

#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2

urllib2.urlopen("http://dynamicdns.park-your-domain.com/update?host=%s&domain=%s&password=%s" % ("@", "domain.com", "password")) 

For my Mail Subdomain

#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2

urllib2.urlopen("http://dynamicdns.park-your-domain.com/update?host=%s&domain=%s&password=%s" % ("mail", "domain", "password"))        

Notice how I removed the @ and inserted the subdomain!

Now I would like help setting correct (Server) /etc/hosts and /etc/hostname in server settings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .