Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/semior001/dnsit
simple as that dns server, accepts /etc/hosts like config for resolving A records
https://github.com/semior001/dnsit
Last synced: about 2 months ago
JSON representation
simple as that dns server, accepts /etc/hosts like config for resolving A records
- Host: GitHub
- URL: https://github.com/semior001/dnsit
- Owner: Semior001
- License: mit
- Created: 2024-07-18T08:02:43.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-15T17:42:20.000Z (3 months ago)
- Last Synced: 2024-10-17T01:14:30.256Z (3 months ago)
- Language: Go
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# dnsit
simple as that dns server, accepts /etc/hosts like config for resolving A records## installation
```bash
go install github.com/Semior001/dnsit@latest
``````bash
docker run --rm -it -p 53:53/udp -v ./my-config-file.conf:/srv/config ghcr.io/semior001/dnsit:latest
```## usage
```
Usage:
dsnit [OPTIONS]Application Options:
--addr= Address to listen on (default: :53) [$ADDR]
--upstream= Upstream DNS server address [$UPSTREAM]
--ttl= TTL for DNS records (default: 5m) [$TTL]config:
--config.path= Path to the configuration file [$CONFIG_PATH]
--config.delay= Delay before applying changes (default: 10s) [$CONFIG_DELAY]
--config.check-interval= Interval to check for config changes (default: 3s) [$CONFIG_CHECK_INTERVAL]tailscale:
--tailscale.tailnet= Tailscale tailnet [$TAILSCALE_TAILNET]
--tailscale.token= Tailscale API token [$TAILSCALE_TOKEN]log:
--log.path= Log file path, empty for stdout [$LOG_PATH]
--log.debug Enable debug mode [$LOG_DEBUG]Help Options:
-h, --help Show this help message```
### configuration
Config is just like a `/etc/hosts` file, but with some additional options in comments.In comment, you can provide a `#!!from: cidr` directive, which will make the next set of records (until the next `!!from`
directive) record only available for the specified CIDR.Example:
```
#!!from: 192.168.174.0/24
192.168.174.2 example.com deeper.example.com
192.168.174.3 foo.bar.com#!!from: 100.10.10.1/32
100.10.10.2 example.com
100.10.10.5 blah.abacaba.com#!!tstag:
#!! - 'tag:foo'
#!! - 'tag:bar'
127.0.0.1 example.com
```This will make `example.com` and `deeper.example.com` resolve to `192.168.174.2` only for clients from `192.168.174.0/24` subnet,
and `example.com` and `blah.abacaba.com` resolve to `100.10.10.2` and `100.10.10.5` respectively only for clients from `100.10.10.1/32` subnet.The third section with `#!!tstag` directive will make `example.com` resolve to the localhost IP address only for clients with `foo` or `bar` tag, tags are received from the Tailscale API.
You can invoke a special query `nslookup semior001.dnsit.refresh-tailscale` to force the server to refresh the tags from the Tailscale API.
## project status
This project is in a very early stage of development, so it may not work as expected. Until v1 is released, the API may change at any time.