directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enrique Rodriguez" <enriqu...@gmail.com>
Subject Re: DNS : RecordStore
Date Tue, 12 Jun 2007 21:15:50 GMT
On 6/12/07, Julien Vermillard <jvermillard@archean.fr> wrote:
> ...
> 1#
> In DNS protocol, the RecordStore interface
> http://tinyurl.com/2prg84

I added your suggestion, re: generics and some minor Javadocs.  I
recently completed a Javadoc run on Kerberos and Change Password and
DNS was on my TODO list.  I'll step it up.

> 2#
> I made my minimal RecordStore for just resolving few hostname to IP
> address. Be carefull, my knowledge of DNS is very low :)
>
> public Set getRecords(QuestionRecord question) throws Exception
>    System.err.println("My store ! : "+question);
>    Set<ResourceRecord> set=new HashSet<ResourceRecord>();
>    HashMap<String, Object> attr= new HashMap<String, Object>();
>    attr.put(DnsAttribute.DOMAIN_NAME,"mydomaine.net");
>    attr.put(DnsAttribute.IP_ADDRESS,"192.168.66.66");
>    attr.put(DnsAttribute.TYPE,"IN");
>    attr.put(DnsAttribute.CLASS,"A");
>    ResourceRecord rr=new ResourceRecordImpl("totoz.net",
>           RecordType.A,RecordClass.IN,10000,attr);
>    set.add(rr);
>    return set;
> }
>
> dig report me "corrupted reply".
>
> Any idea of what I'm doing wrong ?

Just eyeballing it, the only thing in 'attr' should be IP address.
The rest is redundant (and domain name conflicts) with the info put
into the RR constructor.

What is your dig statement?  If you query for "mydomaine.net" but are
returning "totoz.net" that could give you a problem.  With the above
code you should be dig'ing:

$ dig totoz.net

and getting "192.168.66.66".

Your reply could also be corrupted if UDP/TCP isn't being handled
properly.  Our DNS provider doesn't have TCP support, though it is
trivial to add with MINA.  TCP uses a 2-byte pre-pended size, which
could be throwing off the client-side decode.

Enrique

Mime
View raw message