Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a domain configuration file called

I want to add the following subdomain to it: members.example.conf and add it's own MX records (it's running a seperate mail system).

How do I specify the MX records for a subdomain?

share|improve this question
up vote 2 down vote accepted

Same way you specify A records. Keep in mind MX records MUST be FQDNs, not IP addresses.

 subdomain      300 IN A
 mail.subdomain 300 IN A
 subdomain      300 IN MX 0


The first column in your file is currently blank because it's inherited from the record above it (likely your SOA record)

This should be just as valid as what I posted above:

 subdomain      300 IN A
                300 IN MX 0
 mail           300 IN A

Basically, there's more than one way to skin a cat. However, $origins can make things unnecessarily confusing, so sometimes it's better to be verbose.

share|improve this answer
Ah ok, so right now, to specify the MX records for the domain, the first column is blank, but to specify the MX record for the subdomain, I just enter the name of it there..? – Samuurai Dec 23 '09 at 17:13
See my edit in the above post – brent Dec 23 '09 at 17:27
Thanks a lot for your help. We don't have an origin variable and our SOA looks like this:@ IN SOA ( serial, refresh etc...) It might be that it's getting it from the definition in named.conf.include ? – Samuurai Dec 23 '09 at 18:01
BIND automatically sets $ORIGIN to whatever the domain name is set to in that zone's configuration section in named.conf. – Alnitak Dec 24 '09 at 8:25

First, a name like this is not a subdomain, in strict terminology. It is just another name inside the current domain. If it were a subdomain, it would have NS records in the parent domain and and SOA record in the subdomain's file.

If you want to make another name inside your file, all you have to do is simply add it. As others have said, you need to add the MX records for it, using names on the right-hand side. Then add A records for those names. Inside domain "" you could use:

newname          MX 100 mailhost.newname
mailhost.newname A

The TTL can be left to default (as I did here).

@ in the first column means "whatever this zone's apex name is" so it will be taken from the configuration file. @ is a lazy way to write the domain's apex, but only that. For example, you cannot use foo.@ to mean -- it won't work.

share|improve this answer
Thanks a lot. That clarifies it for me. I wish I could vote you up, but I don't have enough rep! – Samuurai Dec 24 '09 at 9:32

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.