ALINK="#FF0000">

"Linux Gazette...making Linux just a little more fun!"


Mail for the Home Network

DNS for Mail

By JC Pollman and Bill Mote


In last month's article we set up dns as a name server for network. Sendmail, and most other mail transport programs, use dns to decide where to send the mail, but we need to modify it a bit.  The name-to-ip file has to have a MX line for each computer, which essentially says: for this computer, use this other computer for storing mail.

The file from last month looks like this. Note, the *** are not part of the file:
**************************************************************
@  IN SOA master.kulai.org. jpollman.kulai.org. (
   1;
   10800;
   3600;
   604800;
   86400 );

        IN NS   master.kulai.org.
master  IN A    192.168.124.10
 

mail    IN A 192.168.124.10
www     IN A 192.168.124.10
news    IN A 192.168.124.10

localhost    IN A    127.0.0.1

fserver IN A  192.168.124.11
jc      IN A  192.168.124.1
phillip IN A  192.168.124.20

**************************************************************

We change this to add in the MX lines. Note: the Bold items are explained below and are not part of the format of the file. It now looks like this:

**************************************************************
@  IN SOA master.kulai.org. jpollman.kulai.org. (
   2
   10800
   3600
   604800
   86400 )

            IN NS   master
            IN MX 10 master
master      IN A    192.168.124.10
master      IN MX 10 master

mail        IN A 192.168.124.10
www         IN A 192.168.124.10
news        IN A 192.168.124.10

localhost   IN A    127.0.0.1

fserver     IN A  192.168.124.11
fserver     IN MX 10  master

jc          IN A  192.168.124.1
jc          IN MX 10 master

phillip     IN A 192.168.124.20
phillip     IN MX 10 master
**************************************************************
Now each computer's (master, fserver, jc, phillip) email server is master.kulai.org (actually it is called a "mail exchanger", but since we have only one computer server mail, it functions as a email server.) We also have a line with no name that points to master.kulai.org as the email server - this is for the domain: kulai.org. You noticed there is a "10" in each line.  The number, 10 in this case, is a relative value, and is used when you have multiple mail exchangers - something we are not covering here. Note, failure to put the number in will cause an error in named. Now, restart named, and check /var/log/messages for any errors.

You have to put a line in for each computer: kulai.org by itself will not work.
 
 


Copyright © 1999, JC Pollman and Bill Mote
Published in Issue 45 of Linux Gazette, September 1999