Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been reading this:

For MX records, and I've setup my nameserver via bind. Here is my zonefile for my website:

$TTL 86400
@   IN  SOA     ns1 root (
        2           ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
; Specify our two nameservers
        IN  NS      ns1
        IN  NS      ns2

; Nameserver resolve
ns1     IN  A
ns2     IN  A

; Mail server
        IN  MX 10   mail

; Hostnames
@       IN  A
www     IN  A
mail    IN  A

I am hosting postfix and dovecot. I am unable to receive emails remotely and I've narrowed it down to my DNS not responding correctly on MX requests.

Dovecot and postfix are both hosted on (I've changed my server IP)

After changing my config and restarting bind,

dig MX @localhost 

EDIT: I've tried both and Both failed. I've updated this question for as I initially posted the dig for (this was an error on my part. It has been updated, though.)

To which I receive,

;              IN      MX

;; AUTHORITY SECTION:            86400   IN      SOA

;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Thu Jul  3 15:29:40 2014
;; MSG SIZE  rcvd: 79

EDIT: Thought I'd include that everything else works fine. I.e.

share|improve this question
up vote 16 down vote accepted

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
; Mail server
        IN  MX 10

is actually

ns2     IN  A
; Mail server
ns2     IN  MX 10

and not what you intended:

ns2     IN  A
; Mail server      IN  MX 10

or alternatively you should have used:

@      IN  MX 10    
share|improve this answer
Thanks. I didn't know that. It explains why it didn't work though. I've simply moved my MX record and placed it under the NS records. It works fine now. – Jason Jul 3 '14 at 19:52
Yes at that location it is the fourth record for the origin ; SOA, two NS records and then the MX record. – HBruijn Jul 3 '14 at 19:54

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

IN  MX 10


IN  MX 10   mail

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

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

share|improve this answer
Yes. when the question was posted it was missing a dot. I updated it really fast once I noticed this and tested it again (I restarted bind). It still doesn't work. I'm going to try it again with mail and reply with my result. EDIT: IN MX 10 mail still doesnt work. – Jason Jul 3 '14 at 19:41

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 MX 10
share|improve this answer
I've changed the serial number to 2 and am now using IN MX 10 mail. I restarted my bind service but I still get the same response from dig. – Jason Jul 3 '14 at 19:43
Serial number shouldn't have mattered in this case since he's directly querying the DNS sever (localhost). It is relevant when propagating though. – Belmin Fernandez Jul 4 '14 at 1:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.