zerotier / zeronsd

A DNS server for ZeroTier users
https://zerotier.com
BSD 3-Clause "New" or "Revised" License
520 stars 58 forks source link

Connection refused (os error 111) #234

Open bruteForce93 opened 7 months ago

bruteForce93 commented 7 months ago

OK so setting your own controller isn't so difficult after all. But setting your own ZT1 DNS Service is a hell of a task!

Following the documentation (strictly) you should ping over the domain names straight away, but for some reason in my case (Ubuntu 22) the zeronsd-.service does not want to connect to the controller or tries to connect to a ZT Central one. (That's what the journalsctl says by the way).

I have exhausted everything for almost a week now, but before giving up completelly and building my own DNS, I am giving it a shot over here, just in case we could resolve it somehow.

So, long story short everything (I mean the timer, the zeronsd-.service, the resolver, systemctl, etc.) is setup, online and works accordingly (or maybe I am wrong after all). The domain I am trying to use is home.arpa for my network fb1ad6192d8be97b.

But, there is always this annoying Temporary failure in name resolution error and I tried journalctl just to see why zeronsd refuses to connect my controller. Notice that the self-hosted controller token has been stashed correctly and given the appropriate permissions. I have also installed the proper amd64.deb packages and followed the tutorial per se. This is what it shows:

INFO zeronsd::init: Welcome to ZeroNS!
Error: Error: Communication Error error sending request for url (http://127.0.0.1:9993/network/fb1ad6192d8be97b): error trying to connect: tcp connect error: Connection refused (os error 111). Are you joined to fb1ad6192d8be97b?
zeronsd-fb1ad6192d8be97b.service: Main process exited, code=exited, status=1/FAILURE
zeronsd-fb1ad6192d8be97b.service: Failed with result 'exit-code'.

This error loops everytime the zeronsd service is scheduled to start, as per the journalctl output. Occasionally I encounter this error:

INFO zeronsd::init: Welcome to ZeroNS!
Error: Communication Error error sending request for url (https://my.zerotier.com/api/v1/network/fb1ad6192d8be97b): error trying to connect: tcp connect error: Network is unreachable (os error 101)
Caused by:
0: error sending request for url (https://my.zerotier.com/api/v1/network/fb1ad6192d8be97b): error trying to connect: tcp connect error: Network is unreachable (os error 101)
1: error trying to connect: tcp connect error: Network is unreachable (os error 101)
2: tcp connect error: Network is unreachable (os error 101)
3: Network is unreachable (os error 101)
zeronsd-fb1ad6192d8be97b.service: Main process exited, code=exited, status=1/FAILURE
zeronsd-fb1ad6192d8be97b.service: Failed with result 'exit-code'.

And this:

INFO zeronsd::init: Welcome to ZeroNS!
Error: Communication Error error sending request for url (https://my.zerotier.com/api/v1/network/fb1ad6192d8be97b): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
Caused by:
0: error sending request for url (https://my.zerotier.com/api/v1/network/fb1ad6192d8be97b): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
1: error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
2: dns error: failed to lookup address information: Temporary failure in name resolution
3: failed to lookup address information: Temporary failure in name resolution
zeronsd-fb1ad6192d8be97b.service: Main process exited, code=exited, status=1/FAILURE
zeronsd-fb1ad6192d8be97b.service: Failed with result 'exit-code'.

Having tried the curl -H "X-ZT1-Auth: commands the CLI gives the correct outputs. I mean the hosts list, the controller status, etc. This means that the 9333 port communicates as intended through CLI, but not through the zeronsd-.service.

Also, having read the solved thread with the same problem, it's hard to undestand how to implement at least a temporary fix. If any exists.

Can you tell my stupid friend over here what is he missing or doing wrong?

laduke commented 7 months ago

Sorry for the lost time. zeronsd doesn't work with self hosted controllers. Maybe it will in the future. It gets the dns names from the Central API. Self hosted network members don't have names. Which solved thread are you referring to?

bruteForce93 commented 7 months ago

Sorry for the lost time. zeronsd doesn't work with self hosted controllers. Maybe it will in the future. It gets the dns names from the Central API. Self hosted network members don't have names. Which solved thread are you referring to?

Thank you for the input! I was referring to this: https://github.com/zerotier/zeronsd/issues/196#issuecomment-1456013476

I even tried compiling the fixed up version from here: https://github.com/laduke/zeronsd/tree/tl-zerotier-url

But there are two errors in utils.rs and it won't let me at least test it and maybe help somehow.