SMTP server entry on the DNS server

Hi,

I would like to make an SMTP server entry in the DNS server.  Can someone instruct me what I need to do to make the entries on the DNS server?  I would like to make the SMTP server to be the highest priority for all mails to go through it prior to going to the appropriate mail server.  How am I able to do that?

Thank you.
gsalcedoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rugdogCommented:
gsalcedo,
   say you have this db file:

$ORIGIN domain.com.
@                       1D IN SOA       @ root (
                                        1               ; serial
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        ns1
                        1D IN NS        ns2
localhost       IN A   127.0.0.1
www             IN A   10.0.0.1
mail               IN A   10.0.0.2
@                  IN MX 0 mail

in this case the host mail.domain.com will be the primary/only mail exchanger for domain.com.

if you have several mail exchangers, say, mail2 and mail3, but you still want mail.domain.com to be the one with highest priority you could have

mail1               IN A   10.0.0.3
mail2               IN A   10.0.0.4
@                  IN MX 0 mail
@                  IN MX 10 mail2
@                  IN MX 20 mail3

remember the number after 0 is the priority, the smaller the higher the priority. Also, if you would want many domains to go to the same server you'll do the same for each domain db file, and of course the machine will have to be prepared to handle every domain.

0
gsalcedoAuthor Commented:
Hi rugdog and yuzh,

Thank you very much for your instructions.  I have two db files on the DNS server.  One of the db files contains the A and MX record and the other database contains the PTR record (reverse lookup).  Currently, I am trying to create a new SMTP server and have it transfer mails to the mail servers.  There is one mail server (Server_1) that is currently works as an SMTP and Mail server.  Eventually, I would like to eliminate that and create it to be just a mail server.  Currently in the first db which contains the A and MX records minus the serial and NS (name server) indication, it looks like this.

;
       IN     A     aaa.aaa.aaa.aaa
       IN     A     10     server_1
;
;
server_1     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             0     mailhost
smtp          IN     CNAME     server_1
;
;

The above information pertains to one mail server that is also an SMTP server.  The mailhost and smtp names are also the server_1.  When I create the new SMTP server (server_2) that will be the first server that all incomming and outgoing mails will go through, I will like to make it to have the lowest preference value, which is the highest priority.  Can I configure the first db file to be as follows?

;
       IN     A     bbb.bbb.bbb.bbb
       IN     A     1       server_2
;
       IN     A     aaa.aaa.aaa.aaa
       IN     A     10     server_1
;
;
server_2     IN     A             bbb.bbb.bbb.bbb
smtp          IN     A              server_2
;
server_1     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             0     mailhost
;
;

Also, on the PTR db file (reverse lookup), the mail server in the file is entered as follows.

;
     IN     MX     10     server_1
;
;
aaa.aaa     IN     PTR     server_1.abc.com
;

When I include the new SMTP server, can I make entries as follows...?

;
     IN     MX     1      server_2
;
     IN     MX     10     server_1
;
;
bbb.bbb     IN     PTR     server_2.abc.com.
;
aaa.aaa     IN     PTR     server_1.abc.com.
;


Thank you very much for your help.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

gsalcedoAuthor Commented:
Sorry... I would like to make some corrections on the first database file that I would like it to be.. if it is possible.

Hi rugdog and yuzh,

Thank you very much for your instructions.  I have two db files on the DNS server.  One of the db files contains the A and MX record and the other database contains the PTR record (reverse lookup).  Currently, I am trying to create a new SMTP server and have it transfer mails to the mail servers.  There is one mail server (Server_1) that is currently works as an SMTP and Mail server.  Eventually, I would like to eliminate that and create it to be just a mail server.  Currently in the first db which contains the A and MX records minus the serial and NS (name server) indication, it looks like this.

;
       IN     A     aaa.aaa.aaa.aaa
       IN     A     10     server_1
;
;
server_1     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             0     mailhost
smtp          IN     CNAME     server_1
;
;

The above information pertains to one mail server that is also an SMTP server.  The mailhost and smtp names are also the server_1.  When I create the new SMTP server (server_2) that will be the first server that all incomming and outgoing mails will go through, I will like to make it to have the lowest preference value, which is the highest priority.  Can I configure the first db file to be as follows?

;
       IN     A     bbb.bbb.bbb.bbb
       IN     A     1       server_2
;
       IN     A     aaa.aaa.aaa.aaa
       IN     A     10     server_1
;
;
server_2     IN     A             bbb.bbb.bbb.bbb
smtp          IN     A              server_2
;
server_1     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     A             aaa.aaa.aaa.aaa
mailhost     IN     mx             2    mailhost
;
;

Also, on the PTR db file (reverse lookup), the mail server in the file is entered as follows.

;
     IN     MX     10     server_1
;
;
aaa.aaa     IN     PTR     server_1.abc.com
;

When I include the new SMTP server, can I make entries as follows...?

;
     IN     MX     1      server_2
;
     IN     MX     10     server_1
;
;
bbb.bbb     IN     PTR     server_2.abc.com.
;
aaa.aaa     IN     PTR     server_1.abc.com.
;


Thank you very much for your help.
0
rugdogCommented:
if you want all incoming traffic of email @yourdomain.com use this on the first db file:

server_2     IN    A        bbb.bbb.bbb.bbb
@              IN    MX 1   server_2

if you add also,

@ IN MX 10 server_1

that will mean that if server_2 is unavailable, the sender will try server_1.

The entry you have like:

mailhost     IN     mx             2    mailhost

is wrong because it means that all email directed @mailhost.yourdomain.com will go to mailhost, and I assume you want an MX for yourdomain.com.

Also, no MX records should be defined in the in-addr db file, the MX records only make sense in forward domain db files.




0
gsalcedoAuthor Commented:
Hi rugdog,

I really appreciate your help.  I notice that you used the "@" sign.  Can it be used on any UNIX DNS server's db file?
0
rugdogCommented:
yes, it is a BIND standard, the @ refers to the $ORIGIN value in your db file, so in the example i wrote at the beginning I used:

$ORIGIN yourdomain.com.

so very time the @ appears it refers to yourdomain.com.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.