On 6/12/07, Julien Vermillard <[EMAIL PROTECTED]> 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

Reply via email to