nbnsd: A free and minimal NetBIOS Name Service responder daemon

Windows-based machines can translate hostnames to IP addresses using a fairly simple protocol that is part of the NetBIOS on TCP/UDP specification (see RFCs 1001 and 1002). Samba supports such name-lookups via nmbd, but that program is big and complicated (about 1.6MiB compiled for ARM). If you just need to support the broadcast-based lookup service, that's overkill. To my surprise, I couldn't find a stand-alone, minimal daemon that would support just lookups (if I can't find it on Google in 5 minutes, does it really exist?), so I wrote one myself. I suspect there must be other such implementations out there. If you are aware of one, please let me know. Otherwise, feel free to use the code below, which is being distributed under the MIT license. Enjoy!