diff --git a/dispatcher/config/config_template.go b/dispatcher/config/config_template.go index c41425b1e..e20bf704b 100644 --- a/dispatcher/config/config_template.go +++ b/dispatcher/config/config_template.go @@ -61,6 +61,7 @@ func GetTemplateConfig() (*Config, error) { }, Timeout: 10, InsecureSkipVerify: false, + Bootstrap: []string{"", ""}, Deduplicate: false, }); err != nil { return nil, err diff --git a/dispatcher/plugin/functional/forward/forward.go b/dispatcher/plugin/functional/forward/forward.go index a3679e20c..31480941b 100644 --- a/dispatcher/plugin/functional/forward/forward.go +++ b/dispatcher/plugin/functional/forward/forward.go @@ -50,6 +50,7 @@ type Args struct { Upstream []Upstream `yaml:"upstream"` Timeout int `yaml:"timeout"` InsecureSkipVerify bool `yaml:"insecure_skip_verify"` + Bootstrap []string `yaml:"bootstrap"` // options for mosdns Deduplicate bool `yaml:"deduplicate"` @@ -73,9 +74,6 @@ func Init(tag string, argsMap handler.Args) (p handler.Plugin, err error) { if len(u.Addr) == 0 { return nil, errors.New("missing upstream address") } - if len(u.IPAddr) == 0 { - return nil, errors.New("missing upstream ip address") - } serverIPAddrs := make([]net.IP, 0, len(u.IPAddr)) for _, s := range u.IPAddr { @@ -87,6 +85,7 @@ func Init(tag string, argsMap handler.Args) (p handler.Plugin, err error) { } opt := upstream.Options{} + opt.Bootstrap = args.Bootstrap opt.ServerIPAddrs = serverIPAddrs if args.Timeout <= 0 {