Can one server do DNS for a domain and a subdomain?

I have a situation where I need to replace the nameservers for both a.b.c and b.c. I'd rather not have to dedicate two machines to this.

I've been reading about multi-homing but the examples all seem to be for *.b.c rather than a domain and a subdomain of the same.

Is this scenario possible with a single machine?


Yes, it's perfectly supported without any problem.

You can even host completely distinct domains in the same machine.

For example, using BIND9 as the DNS server you should put something like this in named.conf:

zone "example.com" {
        type master;
        file "/usr/local/etc/namedb/static/example.com";
        notify yes;
        allow-transfer { nameservers; }
        };
};

zone "subzone.example.com" {
        type master;
        file "/usr/local/etc/namedb/static/subzone.example.com";
        notify yes;
        allow-transfer { nameservers; }
        };
};

Just fill the zone files with your zone data. In the main zone file you can specify the subzones accordly too, with even MX records for mailing, take a look at this example for the file example.com:

; Nameservers records
ns.example.com.         IN      A       192.168.0.10
ns1.example.com.        IN      A       192.168.0.3
ns2.example.com.        IN      A       192.168.0.4

; Delegated internal zones
local.example.com.      IN      NS      ns.example.com.
mgmt.example.com.       IN      NS      ns.example.com.

; Delegated external zones
subzone.example.com.    IN      NS      ns.example.com.
whatever.example.com.   IN      NS      ns.example.com.

; Delegated external zone with its own nameservers (and glue records)
fnord.example.com.      IN      NS      ns1.fnord.example.com.
fnord.example.com.      IN      NS      ns2.fnord.example.com.
ns1.fnord.example.com.  IN      A       198.51.100.1
ns2.fnord.example.com.  IN      A       198.51.100.2

; Mailing zones
lists.example.com.      IN      A       192.168.0.13
                        IN      MX      0 lists.example.com.
                        IN      TXT     "v=spf1 mx ~all"
                        IN      SPF     "v=spf1 mx ~all"

Hope this clarify everything.