uxbh / ztdns Goto Github PK
View Code? Open in Web Editor NEWDNS server for a ZeroTier virtual network
License: MIT License
DNS server for a ZeroTier virtual network
License: MIT License
Looks like the server refuses to serve names with spaces, and it also incorrectly requires you to use capital letters on names with capital letters.
$> go get -u github.com/uxbh/ztdns/
# github.com/miekg/dns
../../go/src/github.com/miekg/dns/msg_helpers.go:144: base32.HexEncoding.WithPadding undefined (type *base32.Encoding has no field or method WithPadding)
../../go/src/github.com/miekg/dns/msg_helpers.go:144: undefined: base32.NoPadding
../../go/src/github.com/miekg/dns/msg_helpers.go:270: undefined: strings.Builder
../../go/src/github.com/miekg/dns/serve_mux.go:43: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:422: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:446: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:474: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:495: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:505: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:517: undefined: strings.Builder
../../go/src/github.com/miekg/dns/types.go:474: too many errors
The default URL in .ztdns.toml gives a 404 error. I searched a bit in the ZeroTier documentation and I think that the API is/can be http://127.0.0.1:9993, however when trying that, I just get a 401 Unauthorized response. Perhaps I'm wrong and there are two separate APIs that I'm conflating, but if that's the case, I'm not sure what to use that won't throw a 404.
This is using go1.10.2 on a Raspberry Pi 3 Model B running Raspbian 9.4 with ZeroTier 1.2.8. I do not seem to be having the same issue as reported in #9
Hi,
I keep getting:
FATA[0002] failed to start DNS server: listen udp6 [ee20::5cde:21ff:fe18:ca2c]:53: bind: invalid argument
whenever I try to start the DNS server.
Using the --config
option does not seem to work.
MWE:
ztdns --config /etc/.ztdns.toml server
Error: no API key provided
Usage:
ztdns server [flags]
Flags:
-h, --help help for server
--interface string interface to listen on
Global Flags:
--config string config file (default is $HOME/.ztdns.toml)
--debug enable debug messages
no API key provided
Running the program with strace
indicates that it only looks in the default locations
getcwd("/home/user", 4096) = 11
newfstatat(AT_FDCWD, "/home/user/.ztdns.json", 0xc0000adca8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.toml", 0xc0000add78, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.yaml", 0xc0000ade48, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.yml", 0xc0000adf18, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.properties", 0xc00013e038, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.props", 0xc00013e108, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.prop", 0xc00013e1d8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.hcl", 0xc00013e2a8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.dotenv", 0xc00013e378, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.env", 0xc00013e448, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.ini", 0xc00013e518, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns", 0xc00013e5e8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.json", 0xc00013e6b8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.toml", 0xc00013e788, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.yaml", 0xc00013e858, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.yml", 0xc00013e928, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.properties", 0xc00013e9f8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.props", 0xc00013eac8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.prop", 0xc00013eb98, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.hcl", 0xc00013ec68, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.dotenv", 0xc00013ed38, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.env", 0xc00013ee08, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.ini", 0xc00013eed8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns", 0xc00013efa8, 0) = -1 ENOENT (No such file or directory)
write(2, "Error: no API key provided\n", 27Error: no API key provided
) = 27
Error: fatal msg="Could not get interface: route ip+net: no such network interface\n"
interface = "zt7nnjn3xu" list in .ztdns.toml in the root directory of the git repo
I can start the service using the pre-compiled executable with the same config file and have no problems.
Running this on CentOS 7 as root.
go get -u github.com/uxbh/ztdns/
Go/src/github.com/miekg/dns/msg_helpers.go:144: base32.HexEncoding.WithPadding undefined (type *base32.Encoding has no field or method WithPadding)
Go/src/github.com/miekg/dns/msg_helpers.go:144: undefined: base32.NoPadding
I am on multiple ZeroTier networks where some hosts also share multiple networks with each other. I'd rather not run multiple DNS servers per network ID, but instead have a single server being able to provide DNS answers for a comma-separated list of network IDs.
Here's how I currently have this implemented: https://github.com/uxbh/ztdns/compare/master...EricTendian:multiple-network-ids?expand=1
Right now this is a breaking change as the hostname would change from member.zt
to member.networkname.zt
, so I'm making this issue to ask for feedback about 1) if this feature would be valuable to others, and 2) how to deal with the breaking change. Perhaps only add the .networkname
if more than one ID is specified?
Hi,
I just installed ztdns on raspberrypi, filled the .ztdns.toml file, and run ./ztdns server
. But it gave me this error :
FATA[0001] Unable to update DNS entries: Unable to get network info: json: cannot unmarshal number 1521624552143 into Go struct field Network.Clock of type int
I use go version go1.10 linux/arm
(armv6), with raspbian 9 (stretch).
zerotier-cli
tells me everything is ok, I authorized the device on my network.
ifconfig
show me same address as in my.zerotier.com
I authorized users to bind privileged port.
What am I missing ? :(
it would be great if you can compile it for openwrt, there is no similar package for openwrt routers and this is highly in demand.
On linux starting server on zt0 gives the following error:
FATA[0000] failed to start DNS server: listen udp6 [fe80::....]:53: bind: invalid argument
I have download ztdns, ths is nice but If I look for an host address I have to query for
.zt.domain.zt
Reverse Resolution will also be nice.
Unable to update DNS entries: Unable to get member list: json: cannot unmarshal array into Go struct field .Config.Tags of type string
# Configuration file for ztDNS
suffix = "zt"
port = 53
interface = "ztyou4q"
# Number of minutes to wait before updating the DNS database again (Default: 30)
DBRefresh = 30
# This section contains information related to your ZeroTier config
[ZT]
# API is used to contact the ZeroTier controller API service.
API = "hQFtY3uX0UH9TGqWabcdefghi"
# URL is the url of the ZeroTier controller API
URL = "https://my.zerotier.com/api"
# This section contains one or more ZeroTier networks
# Format is: domain = "NetworkID"
# Domain does not have to match the configured network name
[Networks]
domain = "networkid3646546"
Like the title says, how does one add the DNS entry - I can't find anything about it on my.zerotier.com
This would be interesting to ship as a CoreDNS plugin, which itself is reasonably easy to deploy and operate.
it would be fantastic to be able to delegate a zone to such plugin something arorund this pseuydoconfig:
domain.zt {
# Automatically load zone files mounted in the "zones" directory
ztdns {
zt_api_token
}
}
Got it running and configured on Windows but the DNS server doesn't seem to be reachable. It picks up the computers in my network correctly and starts the server on port 53 but I'm unable to telnet to it or use it at all. I've allowed it through Windows Firewall, too, so that's not stopping it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.