aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/conf/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'conf/parser.go')
-rw-r--r--conf/parser.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/conf/parser.go b/conf/parser.go
index 5cbf31a7..da21e796 100644
--- a/conf/parser.go
+++ b/conf/parser.go
@@ -277,9 +277,10 @@ func FromWgQuick(s string, name string) (*Config, error) {
for _, address := range addresses {
a := net.ParseIP(address)
if a == nil {
- return nil, &ParseError{l18n.Sprintf("Invalid IP address"), address}
+ conf.Interface.DNSSearch = append(conf.Interface.DNSSearch, address)
+ } else {
+ conf.Interface.DNS = append(conf.Interface.DNS, a)
}
- conf.Interface.DNS = append(conf.Interface.DNS, a)
}
default:
return nil, &ParseError{l18n.Sprintf("Invalid key for [Interface] section"), key}
@@ -366,6 +367,7 @@ func FromUAPI(s string, existingConfig *Config) (*Config, error) {
Interface: Interface{
Addresses: existingConfig.Interface.Addresses,
DNS: existingConfig.Interface.DNS,
+ DNSSearch: existingConfig.Interface.DNSSearch,
MTU: existingConfig.Interface.MTU,
},
}