Setting up MX record for static host for mail server

Discussion in 'Server Operation' started by yngwie, Mar 5, 2009.

  1. yngwie

    yngwie New Member

    I don't understand how the MX record works. From what I read you have to point the MX record to your computer and has something to do with hostname? This is my first attempt at configuring a mail server using postfix on Mandriva 2009. I have a static host configured at dhs.org and an MX record. So if my web site or static host is blah.dhs.org do I make the MX record mail.blah.dhs.org or does it have to match my computer hostname or does it even matter what I name the MX record?

    2nd question
    My computer has two nics one is for lan 192.168.0.1 (eth1 ) hostname: pegasus and the other is for my internet connection 24.x.x.x.(eth0). My computer hostname is pegasus which points to 192.168.0.1

    Trying to follow this guide but confused as to what hostname should be and MX record http://www.howtoforge.com/virtual-u...urier-mysql-squirrelmail-mandriva-2009.0-i386 They use 192.x.x.x address and server1.example.com for the example. Doesn't it have to be FQDN or is that just the MX record has to be FQDN?

    My guess is I use pegasus for hostname in postfix but where do I plug in the MX record in mail server configuration:
    postconf -e 'myhostname = pegasus'
    postconf -e 'mydestination = pegasus, localhost, localhost.localdomain'
    postconf -e 'mynetworks = 127.0.0.0/8'
    postconf -e 'virtual_alias_domains ='???
     
  2. falko

    falko Super Moderator ISPConfig Developer

    First you must create an A record, e.g. mail.blah.dhs.org or dhs.org
    Then you create an MX record as follows:
    Code:
    dhs.org. MX 10 mail.blah.dhs.org (or blah.dhs.org)
    This is if you want to receive emails for dhs.org (e.g. [email protected]).
    If you want to receive emails for blah.dhs.org (e.g. [email protected]), your MX record should look as follows:
    Code:
    blah.dhs.org. MX 10 mail.blah.dhs.org (or blah.dhs.org)
    Take a look at this tutorial: http://www.howtoforge.com/traditional_dns_howto



    I'd get a hostname at dyndns.org and use that one.
     

Share This Page