File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ func LoadConfig(path string, isFile bool) error {
288288
289289 viper .SetDefault ("dns.magic_dns" , true )
290290 viper .SetDefault ("dns.base_domain" , "" )
291- viper .SetDefault ("dns.override_local_dns" , false )
291+ viper .SetDefault ("dns.override_local_dns" , true )
292292 viper .SetDefault ("dns.nameservers.global" , []string {})
293293 viper .SetDefault ("dns.nameservers.split" , map [string ]string {})
294294 viper .SetDefault ("dns.search_domains" , []string {})
@@ -419,6 +419,12 @@ func validateServerConfig() error {
419419 )
420420 }
421421
422+ if viper .GetBool ("dns.override_local_dns" ) {
423+ if global := viper .GetStringSlice ("dns.nameservers.global" ); len (global ) == 0 {
424+ errorText += "Fatal config error: dns.nameservers.global must be set when dns.override_local_dns is true\n "
425+ }
426+ }
427+
422428 if errorText != "" {
423429 // nolint
424430 return errors .New (strings .TrimSuffix (errorText , "\n " ))
You can’t perform that action at this time.
0 commit comments