How to configure DNS Server for Mail Server on Linux

.

Hi again

First you should install the BIND DNS package in your linux server. you can simply install either with aptitude and yum installer or compile it  in your linux. (if you decided to compile approach just wait , i will explain you in my few next posts.)

so you should type:

aptitude install bind9

or

yum install bind.i386

(if you don’t know what exactly the name of package is, you can simply search your package name via the installer. for instance aptitude search bind)

then you should configure your mail server.

the main configuration file of the BIND by default is in the /etc/bind/ directory. therefore you start edit your named configuration files.

vim /etc/bind/named.conf

add the blow configuration before the last  }; in the file.

zone “mehdibehamin.com” {
type master;
file “/etc/bind/mehdibehamin.local”;
};

as you sea you should create the zone configuration file. for instance in the above configuration i set it as mehdibehamin.local.

therefore save the named.conf and in the /etc/bind/ create the new file with the mentioned name.and insert these configuration in it.

$TTL    86400
@               IN              SOA              mehdibehamin.com. root.mehdibehamin.com. (
1                                                                                                                                                                    ; Serial
604800         ; Refresh
86400         ; Retry
2419200         ; Expire
86400 )       ; Negative Cache TTL
;
@                         IN                NS              mehdibehamin.com.
www                 IN                 A                 1.2.3.4
mx                     IN                 A       192.168.0.1
mehdibehamin.com      IN      MX      10      mx.mehdibehamin.com.

note: you can copy the template of the configuration file from /etc/bind/db.local and then edit it :)

with the last configuration line all the packet which mail server sent to whatever@mehdibehamin.com transmited into 192.168.0.1 ip address. (which is the smpt or mail server IP address).

thats it.

regards

Leave a Reply

*

     Copyrighted Mehdi Behamin , All Rights Reserved
    
Blog has been visited 204253 times