Multiple domains.

Kevin Darcy kcd at daimlerchrysler.com
Wed Sep 6 02:10:06 UTC 2000


Nitin Mule wrote:

> Hi all!
>
> I want to setup multiple domains on the same nameserver. Let's say, my
> nameserver
> ns.domain1.com (n.n.n.100) is authoritative for two domains: domain1.com
> and domain2.com.
> Both domains share the same physical network n.n.n.X. I want to host a
> web server
> www.domain2.com on a host n.n.n.200 (IP address). I want to receive all
> email for
> userY at domain2.com on my mail/DNS server ns.domain1.com.
>
> I'm comfortable with domain1.com config and so I'm going to list only
> named.conf and
> domain2.db file. Please let me know if this is a correct setup.  It
> seems to work fine.
>
> Here is my named.conf:
>
> // named.conf
>
> options {
>  directory "/var/named";
> };
>
> zone "." {
>  type hint;
>  file "named.ca";
> };
>
> zone "0.0.127.in-addr.arpa" {
>  type master;
>  file "named.local";
> };
>
> zone "domain1.com" {
>  type master;
>  file "domain1.db";
> };
>
> zone "n.n.n.in-addr.arpa" {
>  type master;
>  file "db.domain1";
> };
>
> zone "domain2.com" {
>  type master;
>  file "domain2.db";
> };
>
> // domain2.db file
>
> domain2.com.       IN      SOA     ns.domain1.com. root.ns.domain1.com.
> (
>                                       2000081101 ; Serial
>                                       28800      ; Refresh
>                                       14400      ; Retry
>                                       604800     ; Expire
>                                       86400 )    ; Minimum
>
>                             IN                      NS
> ns.domain1.com.
>                             IN                      NS    ns.isp.com.
>
>                             IN      MX         50      ns.domain1.com.
>
> ns.domain1.com.  IN      A     n.n.n.100
>
> www                    IN      A     n.n.n.200
>
> // End of domain2.db

The domain1.com zone is where you should be specifying the ns.domain1.com
A record; it doesn't need to be respecified in this zonefile, and in fact
it is considered "out of zone data" and will generate an error message in
the logs.

Otherwise, the zone file looks reasonable.

> Another related question:
> ns.isp.com is a secondary for domain2.com.
>
> Do I need an A record for ns.isp.com in the file domain2.db?

No. Other nameservers can figure that out themselves. The only time "glue
records" are necessary is when the name of a nameserver for a subdomain is
in the subdomain itself, e.g. when ns.example.com is a nameserver for
example.com. That presents a chicken-and-egg dilemma: how can you resolve
names in a domain when the address of the nameserver to use is _in_ the
domain you're trying to resolve names from? This dilemma is solved by
permitting -- actually, requiring -- the parent zone to hold a "glue" A
record. Since isp.com is not a subdomain of domain2.com, no glue record is
necessary. But if you were to delegate a subdomain some day, e.g.
foo.domain2.com, you may run into this requirement.


- Kevin





More information about the bind-users mailing list