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

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

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!

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.

If you want your webserver to be accessible from the outside world, use a service like DynDNS ( - 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’.

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

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 ‘’. Then you would configure the zonefile for bind to resolve:

$TTL 2d           IN SOA (
                        2010083001      ; serial
                        3h              ; refresh
                        1h              ; retry
                        1w              ; expiry
                        1d              ; minimum
                        IN NS
                        IN NS
                        IN A
                        IN MX   10
                        IN MX   20
ns                      IN A
mail                    IN A
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 ‘’ points to your IP. And any mail sent to ‘’ would be sent to ‘’ which again goes to your IP number. In addition, for a perfect setup, your ISP should set the reverse lookup for to return ‘’. Anything else is local configuration of apache and sendmail. Have fun.

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:          local:           local:                     :                    :
*                                 smtp[]

  1. run the following command:
/usr/sbin/postmap /etc/postfix/transport
  1. make a copy a the file /etc/postfix/
cp /etc/postfix/{,.org}
  1. apply the following changes to /etc/postfix/, replacing to match your local network.

---        2010-08-20 10:43:38.000000000 -0700
+++     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 =,
 disable_dns_lookups = no
 relayhost = 
+transport_maps = hash:/etc/postfix/transport
 content_filter = 
 mailbox_command = 
 mailbox_transport = 

  1. start/restart postfix
/etc/rc.d/postfix restart || /etc/rc.d/postfix reload
  1. 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).