11

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?

ethrbunny
  • 2,369
  • 4
  • 41
  • 75
  • This works, yeah. The only thing you can't do is what is known as a "horizontal delegation", which is an attempt to re-delegate something that has already been delegated to you. (if `sub1.example.com` is delegated to you, you can't delegate `sub1.example.com` to someone else) – Andrew B Jun 19 '14 at 03:04

1 Answers1

19

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.

Andrew B
  • 32,588
  • 12
  • 93
  • 131
Vinícius Ferrão
  • 5,520
  • 11
  • 55
  • 95
  • 6
    I snuck an example of a subzone delegation with its own nameservers (and glue records in there). It's better for people to get exposed to that sooner than later. – Andrew B Jun 19 '14 at 02:57
  • Nice. So the 'parent domain' and the 'child domain' having the same IP address isn't an issue? Or is there still the need to have the same NIC responding to multiple IPs? – ethrbunny Jun 19 '14 at 12:01
  • @ethrbunny Nope, no issue from a DNS standpoint. – Andrew B Jun 19 '14 at 13:39
  • @ethrbunny are you a Windows Sysadmin? Because those questions are common in the Windows world. DC's have the requirement of different IP address, different machines and etc. – Vinícius Ferrão Jun 19 '14 at 14:57