noob question multiple db files, soa's and mx records.

Kevin Darcy kcd at
Tue Oct 29 00:00:07 UTC 2002

Joe Oaks wrote:

> Hello guru's
> I have been running bind for a little over 2 years now but don't fully
> understand
> it and how to configure it very well.
> I started out with a single domain name, running mail, ftp, http,
> the
> standard stuff, no big deal. Now however we have multiple domains (mainly
> web)
> this too was no big deal. However this has grown to a need of having
> multiple
> mx records, and I'm unsure how to update this.
> Each domain has its own db file and mx record, and this part was the part
> that was
> messed up and I'm trying to fix. We run qmail as our mail server and for a
> while
> this was fine one instance controlling all domains. I'm in the process of
> setting
> up a separate instance of qmail for each domain, and for that I need to get
> my
> dns setup correctly.
> My question to you guys is this,
> 1) has multiple ip's, and I want to bind to
> and to say imp, but I'm
> lost
>    in how to do this in the db files. trells and bazalar each have there own
>    db file.
> Once I can get an understanding of how to do this I can then setup the mx
> records.
> Would I make the mx line like
> a) @               IN      MX      10
> or
> b)       IN      MX              10
> and then the mx line similar, using the actual ip instead of
> the @?

No, the only thing that goes on the lefthand side of the resource record is
something that belongs in the zone itself, so unless you want a name like
"", option (b) is out of the question.

If you want to use the name "" in an MX record, then you need to
associate that name with an IP address via an A record, just as you would for
an FTP server, an HTTP server, or any other kind of server. So you'd have
something like

mail    in    a

in the zonefile. As long as that A record exists, you can point MX
records to it.

So, what would the MX record look like? It depends on what the name of the MX
record is. If you want the name of the MX record to be the name of the zone,
then option (a) (with "@" on the lefthand side) should work. If in the future
you want subdomains of to be mailable, you'd add those MX records
too, e.g.:

foo    in    mx    0    mail2

would allow user at to be mailable, assuming there was a working
mail server at whatever address "" resolved to.

> also on a side note, in the soa second line i.e.
>     IN      SOA (
> for the other domains, i.e. what would I put here, since its the
> same
> machine?
>     IN      SOA (

There's no rule that says the contents of those fields, i.e. the "origin" of
the zone, and the mail address for the zone administrator, have to be in same
domain as that of the SOA (see for example, the SOA record for, which has names for both of those
fields). So go ahead and use the same information for those two fields in both
SOA records.

- Kevin

More information about the bind-users mailing list