uxbh / ztdns

DNS server for a ZeroTier virtual network
MIT License
246 stars 50 forks source link

Adding DNS handler to get server to accept queries, other small documentation improvements #5

Closed EricTendian closed 6 years ago

EricTendian commented 6 years ago

I tried to get the server working on Linux and it was able to start up, but did not accept queries (returned SERVFAIL for all of them). After some research I found some example code that uses the library and noticed one part missing was that the handler was never linked up with HandleFunc, so the function to resolve the queries was never called. It looks like https://github.com/uxbh/ztdns/commit/d1cc2ee280f557591b3b3d308aa359eebab9402b#diff-57902bb8143867024d6b4e34a41bea1cL41 removed the call to HandleFunc.

I added that to dnssrv/dnssrv.go and the server now works for me. I compiled it for Windows and tested on a Windows 10 machine, and it works there as well, so that should resolve #4. Thus, the README was also updated to remove the note for Windows.

Besides that, I noticed the cmd/server.go file was using Windows line endings while all other files were using Unix line endings, so converted the file for consistency - no logic was changed in the file. I also noticed the default config file path printed out by running ztdns without arguments still had .yaml while the file was a .toml file, so fixed that extension. I also fixed a few spelling errors in the README.

AarynSmith commented 6 years ago

Thanks for the contribution!