From 3277362e6e4937bf065aab0ae2e47d71c50531fe Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Mon, 16 Mar 2020 19:29:16 +0000 Subject: [PATCH] no DNS by default --- add.go | 2 ++ configtypes.go | 2 +- init.go | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/add.go b/add.go index 9f6dd69..81290fd 100644 --- a/add.go +++ b/add.go @@ -60,7 +60,9 @@ func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) { const peerConf = `[Interface] Address = {{ .Peer.IP }} PrivateKey={{ .Peer.PrivateKey.Key }} +{{- if .DsnetConfig.DNS }} DNS = {{ .DsnetConfig.DNS }} +{{ end }} [Peer] PublicKey={{ .DsnetConfig.PrivateKey.PublicKey.Key }} diff --git a/configtypes.go b/configtypes.go index 68697f3..31b8672 100644 --- a/configtypes.go +++ b/configtypes.go @@ -40,7 +40,7 @@ type DsnetConfig struct { // Network is chosen randomly when not specified Network JSONIPNet `validate:"required"` IP net.IP `validate:"required"` - DNS net.IP `validate:"required"` + DNS net.IP // extra networks available, will be added to AllowedIPs Networks []JSONIPNet `validate:"required"` // TODO Default subnets to route via VPN diff --git a/init.go b/init.go index ef73d1f..79d0e0c 100644 --- a/init.go +++ b/init.go @@ -32,7 +32,8 @@ func Init() { IP := conf.MustAllocateIP() conf.IP = IP - conf.DNS = IP + // DNS not set by default + //conf.DNS = IP conf.MustSave()