bind domain and subdomain on same machines

Matthew Seaman matthew at FreeBSD.org
Sat Jan 3 22:00:37 UTC 2015


On 03/01/2015 21:40, helen ly wrote:
> can I configure Secondary DNS Server on same primary machine
> I have virtual interfaces
> i want to make as a domain(primary) and a subdomain(secondary)
> can this be archievd only with one zone file for two(domain,subdomain) and one named.conf.local

Sure, you can do this, but not with just one zone file.  You will need
two zone definitions in your named.conf.  Something like:

    zone "example.com" {
        type master;
        file "/usr/local/etc/namedb/master/example.com";
        allow-query {
            any;
        };
        allow-transfer {
            secondaries;
        };
    };

    zone "foo.example.com" {
	type "slave";
	masters {
	    192.0.2.1;
	};
	allow-query {
	    any;
        };
    };

But you will definitely need separate zone files for the parent and
child domains.  That's the only way you can have one as primary and the
other as a secondary.  However, when BIND is acting as the secondary it
just transfers the zone data from the primary, and you don't have to do
anything to that file other than provide space for it in your filesystem.

Consult the Bind9 ARM for the details of what you can put into zone
definitions.  Also remember you need to delegate the sub-zone to
whatever nameservers you're using by adding suitable NS records in your
zone data.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 971 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20150103/c2197316/attachment.sig>


More information about the freebsd-questions mailing list