Re: subdomain delegation

Kris Nielander <[email protected]> Thu, 12 Mar 2009 11:05:49 +0100
Newsgroups gmane.network.dns.bind9.dlz
Organization We Dare
Message-ID <[email protected]>
On Wed, 2009-03-11 at 20:23 +0100, Todd Lyons wrote:
> On Wed, Mar 11, 2009 at 3:00 AM, Kris Nielander <[email protected]> wrote:
> >
> > 0 IN CNAME 0.0-26
> > 1 IN CNAME 1.0-26
> > 2 IN CNAME 2.0-26
> > ...
> >
> > I also have need for the NS records.
> >
> > 0-26 IN NS ns1.example.net.
> > 0-26 IN NS ns2.example.net.
> >
> > This works fine. However, all the editing needs to be done in the main
> > zone which spans multiple customers. So I created a subzone per
> > customer.
> >
> > 0-26.1.1.1.in-addr.arpa
> >
> > With two NS records
> >
> > @ IN NS ns1.example.net.
> > @ IN NS ns2.example.net.
> 
> You also need the SOA record for that subzone.  I think it would be
> best if you showed all records for one delegated zone.

I could...

| 21197 | @    | 0-26.1.1.1.in-addr.arpa | 21600 | SOA  |
ns1.we-dare.net. beheer.we-dare.net. 2009031102 21600 3600 604800 86400
|


> 
> > That doesn't work. However, if I swap the '@' for an '*' it does! Now I've looked
> > at the query logs and the query using an '*' passes right before the query using
> > an '@'. Surely, that can't be right or is that just spec?!
> 
> Can you post the actual queries as well?

My test zone: 0-26.0.168.192.in-addr.arpa

9 Query       select name from dns_zone where name =
'1.0-26.0.168.192.in-addr.arpa'
9 Query       select name from dns_zone where name =
'0-26.0.168.192.in-addr.arpa'
9 Query       select ttl, type, case when type='TXT' then concat('"',
data, '"') else data end as data from dns_record where zone_id =
'0-26.0.168.192.in-addr.arpa' and host = '1'
9 Query       select ttl, type, case when type='TXT' then concat('"',
data, '"') else data end as data from dns_record where zone_id =
'0-26.0.168.192.in-addr.arpa' and host = '*'
9 Query       select ttl, type, case when type='TXT' then concat('"',
data, '"') else data end as data from dns_record where zone_id =
'0-26.0.168.192.in-addr.arpa' and host = '@'



> 
> >        {select name from dns_zone where name = '%zone%'}
> >        {select ttl, type, case when type='TXT' then concat('\"', data,
> > '\"') else data end as data from dns_record where zone_id = '%zone%' and
> > host = '%record%'}
> >        {}
> 
> The 4th query above specifies that you do not do a separate lookup for
> NS and SOA and that those records are returned by the 3rd query,
> immediately above it.

Indeed. At first I used all lines, however this caused a segfault on
reverse lookups for some odd reason. (I did not return SOA or NS types
in the lookup!)

> <snip>
> 
> > Main zone queries (I'll skip the CNAME resolve process):
> >
> > select name from dns_zone where name = '1.0-26.1.1.1.in-addr.arpa';
> > select name from dns_zone where name = '0-26.1.1.1.in-addr.arpa';
> > select name from dns_zone where name = '1.1.1.in-addr.arpa';
> > select ttl, type, case when type='TXT' then concat('\"', data, '\"')
> > else data end as data from dns_record where zone_id =
> > '1.1.1.in-addr.arpa' and host = '0-26';
> >
> > Subzone queries:
> >
> > select name from dns_zone where name = '1.0-26.1.1.1.in-addr.arpa';
> > select name from dns_zone where name = '0-26.1.1.1.in-addr.arpa';
> > select ttl, type, case when type='TXT' then concat('\"', data, '\"')
> > else data end as data from dns_record where zone_id =
> > '0-26.1.1.1.in-addr.arpa' and host = '1';
> > select ttl, type, case when type='TXT' then concat('\"', data, '\"')
> > else data end as data from dns_record where zone_id =
> > '0-26.1.1.1.in-addr.arpa' and host = '*';
> > elect ttl, type, case when type='TXT' then concat('\"', data, '\"') else
> > data end as data from dns_record where zone_id =
> > '0-26.1.1.1.in-addr.arpa' and host = '@';
> 
> Show the data returned by these queries.
> 
> My bet is that no SOA is being returned for the subzone, but that's just a WAG.

+-------+------+-------------------------------------------------------------------------+
| ttl   | type | data
|
+-------+------+-------------------------------------------------------------------------+
| 21600 | NS   | amnesiac.we-dare.net.
| 
| 21600 | NS   | amnesiac2.we-dare.net.
| 
| 21600 | SOA  | ns1.we-dare.net. beheer.we-dare.net. 1224199267 21600
3600 604800 86400 | 
+-------+------+-------------------------------------------------------------------------+

I added the SOA later, but to no avail. Change the hostname into an '*'
instead of an '@' and it does work. 

Cheers,

> --
> Regards...      Todd
> All truth passes through three stages. First, it is ridiculed. Second,
> it is violently opposed. Third, it is accepted as being self-evident.
> 
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Bind-dlz-testers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
-- 
Kris Nielander
Network Engineer
t: +31.10.750.7007
f: +31.10.750.7005
w: http://www.we-dare.net/


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com