dnsextd, TCP, and IPv6

Posted Tue 02 March 2010 17:45 under category programming

Hello interested parties. dnsextd (in my git repository) now supports TCP. It was actually sort of an amusing bug. I guess the dnsextd code must date back to PowerPC, because it had an extra ntoh call which on little-endian systems would cause TCP requests to fail. It's fixed in the "tcp" branch of my git repository. In case you're curious as to how to get that repository, you would use the following:

% git clone http://files.roguelazer.com/projects/mDNSResponder-214.git
% cd mDNSResponder-214
% git branch --track tcp origin/tcp
% git checkout tcp

If you need more setup help, Dynamic DNS: Part Two contains all the gory details. If you decide to use mDNSResponder-215 and want to apply the patches, here's a patch you can apply on top of the one from the linked post to add TCP support: [dnsextd_posix-215-tcp.patch][].

With TCP support comes (sorta) something useful: IPv6 support. dnsextd itself isn't well-designed to handle IPv6, since it'd be a really obnoxious refitting job to get it to listen on those other sockets and understand sockaddr_in6's and what have you. However, DNS-over-TCP can support IPv6 with the following very simple command line:

sudo nc6 -6 --continuous -lp 53 --exec "nc6 -4 localhost 53"

Is it as good a solution as actually listening on IPv6? No. Does it incur the penalty of spawning a new process on every single connection? Yes. Is it good enough for me to be happy with for playing with? Also yes. :-)

As usual, feel free to comment below or e-mail if you have any questions or concerns. Cheers.


Comments