Results 1 to 5 of 5

Thread: Help configuring mail/web server with a static ip

  1. #1
    alexbariv's Avatar
    alexbariv is offline Student Penguin
    Join Date
    Jan 2009
    Location
    Mérida, Venezuela
    Posts
    76

    Question Help configuring mail/web server with a static ip

    Hi people.

    I think that i lost my memory, because i completely forgot how to accomplish this.

    I have a WEB/MAIL server configured to work on a static IP address, lets say 200.11.22.33.

    Now I wanna point a domain to that server to get the services up and running, lets say mydom.com ...

    The static IP Address is assigned by my Internet Provider.

    I'm lost in the part of connecting the domain with the server.

    I have the domain DNS pointing to the ISP name servers, but I don't remember if this is the correct way, or if I have to setup my own DNS server...

    A little help here?

    Thanks in advance!
    Alex

  2. #2
    whych's Avatar
    whych is offline Wise Penguin
    Join Date
    Oct 2008
    Location
    North Wales, UK
    Posts
    1,140

    Default Re: Help configuring mail/web server with a static ip

    Is this server running on a fixed public ip address or your own private server which on a line that changes every now and then?
    If it's a static public address, you need to get your isp to create the A and MX records. These should then be picked up no matter what dns server is used.
    If the ip address is likely to change, then you need an account with one of the dynamic dns services.
    http://catb.org/~esr/faqs/smart-questions.html
    (How to ask questions)

  3. #3
    please_try_again is online now Flux Capacitor Penguin
    Join Date
    Sep 2008
    Posts
    7,448

    Default Re: Help configuring mail/web server with a static ip

    If you want your webserver to be accessible from the outside world, use a service like DynDNS (DynDNS.com - Free Domain Name, Managed DNS, Email Services) . Some providers offer similar services.
    If you want to be able to send mail (or more exactly if you don't want your emails to come back to you), you should configure sendmail (Postfix) to use your provider's smtp as a 'smarthost'.

  4. #4
    vodoo's Avatar
    vodoo is offline Wise Penguin
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,540

    Default Re: Help configuring mail/web server with a static ip

    I have a WEB/MAIL server configured to work on a static IP address, lets say 200.11.22.33.
    Is this your real IP number? If yes, then it does not (yet) resolve on a reverse lookup.

    What you have to do:

    There must be at least one but normally two DNS servers for a domain name associated with that IP number. This can be set up by your ISP, or you do it yourself with bind. The DNS servers must have at least an A record and an MX record for your domain. Let's assume your domain is 'sampledom.com'. Then you would configure the zonefile for bind to resolve:

    Code:
    $ORIGIN .
    $TTL 2d
    sampledom.com           IN SOA  ns.sampledom.com.    admin.sampledom.com. (
                            2010083001      ; serial
                            3h              ; refresh
                            1h              ; retry
                            1w              ; expiry
                            1d              ; minimum
                            )
                            IN NS   ns.sampledom.com.
                            IN NS   ns.otherdns.com.
                            IN A    200.11.22.33
                            IN MX   10 mail.sampledom.com.
                            IN MX   20 mail.secondarymailserver.com.
    $ORIGIN sampledom.com.
    ns                      IN A    200.11.22.33
    mail                    IN A    200.11.22.33
    www                     CNAME   ns
    Your secondary slave DNS can copy from the primary. Then you must register your DNS servers with your domain name provider. That's it.

    Now any lookup for 'www.sampledom.com' points to your IP. And any mail sent to 'someone@sampledom.com' would be sent to 'mail.sampledom.com' which again goes to your IP number. In addition, for a perfect setup, your ISP should set the reverse lookup for 200.11.22.33 to return 'mail.sampledom.com'. Anything else is local configuration of apache and sendmail. Have fun.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  5. #5
    please_try_again is online now Flux Capacitor Penguin
    Join Date
    Sep 2008
    Posts
    7,448

    Default Re: Help configuring mail/web server with a static ip

    To make it clear, there are two methods. Either you setup a DNS server, as vodoo described above, or you get postfix to use your provider's smtp.
    I'll try to expose the other method :

    1) create the file /etc/postfix/transport with a content similar to the following:
    Code:
    samplehost.sampledom.com          local:
    localhost.sampledom.com           local:
    sampledom.com                     :
    .sampledom.com                    :
    *                                 smtp[yourprovidersmtp.com]
    2) run the following command:
    Code:
    /usr/sbin/postmap /etc/postfix/transport
    3) make a copy a the file /etc/postfix/main.cf
    Code:
    cp /etc/postfix/main.cf{,.org}
    4) apply the following changes to /etc/postfix/main.cf, replacing
    192.168.xxx.0 to match your local network.

    Code:
    --- main.cf.orig        2010-08-20 10:43:38.000000000 -0700
    +++ main.cf     2010-08-20 10:43:38.000000000 -0700
    @@ -699,11 +699,12 @@
     program_directory = /usr/lib/postfix
     inet_interfaces = localhost
     masquerade_domains = 
    -mydestination = $myhostname, localhost.$mydomain
    +mydestination = $myhostname, localhost.$mydomain, localhost
     defer_transports = 
    -mynetworks_style = subnet
    +mynetworks = 192.168.xxx.0/24, 127.0.0.0/8
     disable_dns_lookups = no
     relayhost = 
    +transport_maps = hash:/etc/postfix/transport
     content_filter = 
     mailbox_command = 
     mailbox_transport =
    5) start/restart postfix
    Code:
    /etc/rc.d/postfix restart || /etc/rc.d/postfix reload
    6) you should also set SMTPD_LISTEN_REMOTE="yes" in /etc/sysconfig/mail, whether you use this method or the other one.

    ----------------------------
    This method allows you to send mails directly without having to set up a DNS server.
    However if you want to receive emails from the outside world, you have to apply the other method (which is more elegant).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Friendly URLs by vBSEO 3.5.2