Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
add configuration layer for the whole app
Browse files Browse the repository at this point in the history
  • Loading branch information
mfuentesg committed Apr 27, 2022
1 parent 8674bd8 commit 833d579
Show file tree
Hide file tree
Showing 6 changed files with 261 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist/
.DS_Store
tmp
localdns.db
.localdns.yaml
17 changes: 8 additions & 9 deletions .localdns.default.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---

# specify the external dns to resolve unknown domain names
forward_to: 8.8.8.8:53

# enable or disable local dns features
features:
udp_enable: true
tcp_enabled: true
grpc_enabled: true
prometheus_enabled: true
remote_server: 8.8.8.8:53

# configuration per services exposed by localdns
servers:
dns:
dns_tcp:
addr: :8053
enabled: true
dns_udp:
addr: :8053
enabled: true
grpc:
addr: :8080
enabled: true
prometheus:
addr: :9090
enabled: true

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ But, the most powerful reason is **Just for fun**.

## Development

`localdns` supports embedded databases like [sqlite](https://www.sqlite.org/index.html) for persistent storing.
`localdns` uses [sqlite](https://www.sqlite.org/index.html) as storage layer.

If you want to run your own instance of `localDNS`, go to the [releases page](https://github.com/mfuentesg/localdns/releases) and download the most convenient binary for you, or, clone this repo and execute `go run main.go` and the magic will start.

### Config file

`localdns` is fully configurable, just edit the autogenerated `.localdns.yaml` file and change it as your convenience.

### gRPC

`localDNS` exposes a gRPC server in order, it brings you the flexibility to develop something awesome, like a custom UI to add/remove/edit records.
Expand Down
34 changes: 25 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ require (
github.com/jmoiron/sqlx v1.3.4
github.com/miekg/dns v1.1.46
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
google.golang.org/grpc v1.44.0
google.golang.org/protobuf v1.27.1
github.com/spf13/viper v1.11.0
github.com/stretchr/testify v1.7.1
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
modernc.org/sqlite v1.14.8
)

Expand All @@ -19,16 +20,16 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
lukechampine.com/uint128 v1.1.1 // indirect
Expand All @@ -42,4 +43,19 @@ require (
modernc.org/token v1.0.0 // indirect
)

require github.com/mattn/go-sqlite3 v1.14.12 // indirect
require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-sqlite3 v1.14.12 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 833d579

Please sign in to comment.