"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. (
   86400 );

        IN NS   master.kulai.org.
master  IN A

mail    IN A
www     IN A
news    IN A

localhost    IN A

fserver IN A
jc      IN A
phillip IN A


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. (
   86400 )

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

mail        IN A
www         IN A
news        IN A

localhost   IN A

fserver     IN A
fserver     IN MX 10  master

jc          IN A
jc          IN MX 10 master

phillip     IN A
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