On Tue, Jul 26, 2016 at 01:00:43AM -0300, Rodrigo Mosconi wrote:
> Hi,
> 
> For a course work, I wrote a simple DNS lookup utility using only the
> native libc.  It`s not yet a complete replacement for dig/host/nslookup,
> but I can work to improve it later.
> I would like to receive any comments about it.
> 
> 
> Follow the diff.
> 
> thx,
> 
> Mosconi

Hello Rodrigo Mosconi,

I haven't used this utility only read the code a little.  I think the
bsearch of the RR types is cool.  I did think that when you cast to 
unsigned long for some SOA values you may be doing something unintended,
it's better to cast to uint32_t IMO if casting at all.  The reason being
an unsigned long on amd64 is 8 bytes size, and 4 bytes size on i386.

Anyhow since you're leaning on libasr you're getting experience with it.
There was a call by OpenSMTPD on twitter a while back that "if DNSSEC is put
into libasr, they would look into DANE".  I don't know where the status of
that is now.  I did some code and posted it to the freenode IRC channel
#opensmtpd, since eric was very busy at the time I don't know if he saw it.

What you can do is perhaps look into getting a full dnssec stack into libasr
as a follow up project if you want.  I'd try to get in touch with eric@ if
you're interested in that.  Perhaps you guys can form a coding group to make
this horrendously difficult project easier.

If you're interested in that I'd recommend to you this book that I also have 
that I use for my DNSSEC implementations.  It's called "The DNSSEC 
Specifications" by Reed Media Services.  It's basically the RFC's printed out 
and put into a book, but it's handy for dealing with DNSSEC since you have 
an offline copy of the RFC's to read at places where there is no computer.

If that's not the way you want to go, perhaps you want to write a DNS server.
I did this and my code can be found at http://delphinusdns.centroid.eu.  I'm
currently programming on a sign utility for DNSSEC signing zones.  DNS is a
never ending subject and I've been programming 10+ years on my DNS server, what
I have learned is that it's a long term commitment to do any code for DNS.

So in conclusion, you've proved that you can code DNS, a few doors open for
you but they promise to be a long journey to reach the final destination and
a lot of hard work.  You can choose to close those doors and stick with the
achievement of a dig like tool and persue other short term projects or you
can take the leap, but it'll consume your life for years on end if you stay
at it.  It can be profitable for you if you market it right, or it can keep
you unfed for a decade or longer.  I'm just saying. :-)

To reiterate I think your code looks fairly good with minor nits given from
a mediocre programmer such as me.

Best Regards,

-peter

Reply via email to