directory-dev mailing list archives

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

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,"");
>    attr.put(DnsAttribute.IP_ADDRESS,"");
>    attr.put(DnsAttribute.TYPE,"IN");
>    attr.put(DnsAttribute.CLASS,"A");
>    ResourceRecord rr=new ResourceRecordImpl("",
>           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 "" but are
returning "" that could give you a problem.  With the above
code you should be dig'ing:

$ dig

and getting "".

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.


View raw message