sinamics / ztnet

ZTNET - ZeroTier Web UI for Private Controllers with Multiuser and Organization Support.
https://ztnet.network
GNU General Public License v3.0
587 stars 60 forks source link

[Bug]: DNS not setting properly #576

Closed W1BTR closed 3 weeks ago

W1BTR commented 1 month ago

🐛 Describe the Bug

When in the DNS section of our network, setting a domain to a server on the network doesnt appear to do anything. It adds the IP of the server to the "SERVERS" section, but the domain isnt listed there, and even with "Allow DNS Configuration" checked it doesnt seem to work

image

🔍 Steps to Reproduce

  1. Create a network
  2. Add a server
  3. Attempt to assign a domain to that server with DNS

🌐 Browser

Chrome

🔧 Deployment Type

✨ Expected Behavior

DNS record is added, allowing us to visit that server directly via a domain.

📋 ZTNET Logs

No response

🖼 Screenshots

No response

W1BTR commented 4 weeks ago

Bumping this one again - we'd really like to move away from Tailscale for our internal DNS stuffs

sinamics commented 3 weeks ago

The domain name should be preserved in the Search Domain input box, while the ip's will be listed under servers. You can only add one domain with several IP`s

image

https://docs.zerotier.com/api/service/ref-v1/#tag/Controller/operation/network_postNetwork

W1BTR commented 3 weeks ago

Got it. It is preserved when I reload the page, but DNS does not resolve for any clients. I did verify they have dns checked in the options for the zerotier client

Also thats an odd implementation, not sure how having numerous servers could function, but I get that's a Zerotier thing, not a ZTNet thing.

W1BTR commented 3 weeks ago

An example here: image image

However I do see it under "DNS Domain" image

W1BTR commented 3 weeks ago

I think I figured out what's going on, my assumption was that I was able to set a domain and have it point to an IP address, like Tailscale's magic DNS.

Is this instead letting us set the IP of DNS servers?

W1BTR commented 3 weeks ago

Nope, I still have no idea what this is supposed to do.

If Im adding a DNS server (as opposed to a dns for a server, such as a website), why does it need a domain, what is a search domain?

I either need to tell all clients connected to:

  1. Forward any traffic from some.domain.com to a zerotier ip
  2. Set the dns server for connected clients

This option isnt able to do either of those, so what does it do?

W1BTR commented 3 weeks ago

Ok so I figured it out. The domain it's looking for here is kind of like a wildcard.

For example, if you enter in mydomain.com, then anything that ends with .mydomain.com (for example, test.mydomain.com) will be forwarded to the DNS servers provided.

I then forwarded them to an adguard dns server that has a custom filtering rool directing to the zerotier ip address of the server.

Feels very hacky and limited but... works