Having trouble with DNS MX records

Solution 1:

A really tricky configuration error. By starting a line with neither a hostname, the zone name or the @ shorthand for the zone origin, becomes a continuation of the record above.

ns2     IN  A       2.2.2.2
; Mail server
        IN  MX 10   mail.example.com.

is actually

ns2     IN  A       2.2.2.2
; Mail server
ns2     IN  MX 10   mail.example.com.

and not what you intended:

ns2     IN  A       2.2.2.2
; Mail server
example.com.      IN  MX 10   mail.example.com.

or alternatively you should have used:

@      IN  MX 10   mail.example.com.    

Solution 2:

I think you're missing a dot. It should read

IN  MX 10   mail.example.com.

or

IN  MX 10   mail

Otherwise it will be relative to your zone, i.e. results in mail.example.com.example.com..

I'm not sure if this is really the problem but give it a try.

Solution 3:

If you don't change the serial number of your zone file, it will not update anything.

There is already a question on SF regarding the importance of serial number in DNS zone files: DNS records serial number


After re-reading your zone, I believe your MX is not properly "declared".

it should read

example.com. MX 10 mail.example.com.