no DNS by default

This commit is contained in:
Callan Bryant 2020-03-16 19:29:16 +00:00
parent dd5ab03771
commit 3277362e6e
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
3 changed files with 5 additions and 2 deletions

2
add.go
View File

@ -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 }}

View File

@ -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

View File

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