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()