User-agent: Mozilla Thunderbird 0.7 (Macintosh/20040616)
Eric Wing wrote:
Hi, now that I have something that's kind of working
on Linux, I thought I would try out FreeBSD and
Solaris, but I'm having problems with name lookups.
I have a small test program using the sockets API and
when DNSRegisterReply() is triggered, I get a const
char* hosttarget.
From the documentation, I'm under the impression that
I should call gethostbyname(hosttarget); to ultimately
figure out the IP address to use. First, is this the
correct way to do things?
From what you've said, I think so.
If so, I'm having problems with the correct name
resolution returned by gethostbyname(). The ".local."
in the hosttarget string is causing the call to fail.
I noticed that in Linux, a libnss_mdns-0.2.so is
created, /etc/nsswitch.conf is modified, and
/etc/nss_mdns.conf is created.
I seem to be missing this library and support files
when I try installing on FreeBSD and Solaris. What do
I need to do to allow gethostbyname() to handle the
.local. qualifier correctly?
Port libnss_mdns :)
For *BSD, the internal API for the name service switch is different to that
for Linux. While the underlying code should be useable unmodified, the
interface layers will need to be rewritten. I've not been inspired to do
this yet.
I haven't looked into porting to Solaris, though this may inspire you:
info libc "Name Service Switch" on a linux box:
" The GNU C Library contains a cleaner solution of this problem. It is
designed after a method used by Sun Microsystems in the C library of
Solaris 2. GNU C Library follows their name and calls this scheme
"Name Service Switch" (NSS)."
It's possible that a Solaris port might be simply a matter of recompiling,
but I've never done system level work on Solaris so I can't help there.
Note: Darwin already has mDNS functionality built in. It is enabled via
config files in /etc/resolver.