"ipam": {
"type": "host-local",
"subnet": "10.1.1.0/24"
- }
+ },
+ "dns": [
+ "8.8.8.8",
+ "8.8.4.4"
+ ]
}
## Network configuration reference
* `ipMasq` (boolean, optional): set up IP Masquerade on the host for traffic originating from this network and destined outside of it. Defaults to false.
* `mtu` (integer, optional): explicitly set MTU to the specified value. Defaults to value chosen by the kernel.
* `ipam` (dictionary, required): IPAM configuration to be used for this network.
+* `dns` (string array, optional): name servers to return as is in the [Result](/SPEC.md#result). Defaults to empty list.
type Result struct {
IP4 *IPConfig `json:"ip4,omitempty"`
IP6 *IPConfig `json:"ip6,omitempty"`
+ DNS []string `json:"dns,omitempty"`
}
func (r *Result) Print() error {
type NetConf struct {
types.NetConf
- BrName string `json:"bridge"`
- IsGW bool `json:"isGateway"`
- IPMasq bool `json:"ipMasq"`
- MTU int `json:"mtu"`
+ BrName string `json:"bridge"`
+ IsGW bool `json:"isGateway"`
+ IPMasq bool `json:"ipMasq"`
+ MTU int `json:"mtu"`
+ DNS []string `json:"dns"`
}
func init() {
}
}
+ result.DNS = n.DNS
return result.Print()
}
type NetConf struct {
types.NetConf
- Master string `json:"master"`
- Mode string `json:"mode"`
- MTU int `json:"mtu"`
+ Master string `json:"master"`
+ Mode string `json:"mode"`
+ MTU int `json:"mtu"`
+ DNS []string `json:"dns"`
}
func init() {
return err
}
+ result.DNS = n.DNS
return result.Print()
}
type NetConf struct {
types.NetConf
- Master string `json:"master"`
- Mode string `json:"mode"`
- MTU int `json:"mtu"`
+ Master string `json:"master"`
+ Mode string `json:"mode"`
+ MTU int `json:"mtu"`
+ DNS []string `json:"dns"`
}
func init() {
return err
}
+ result.DNS = n.DNS
return result.Print()
}
type NetConf struct {
types.NetConf
- IPMasq bool `json:"ipMasq"`
- MTU int `json:"mtu"`
+ IPMasq bool `json:"ipMasq"`
+ MTU int `json:"mtu"`
+ DNS []string `json:"dns"`
}
func setupContainerVeth(netns, ifName string, mtu int, pr *types.Result) (string, error) {
}
}
+ result.DNS = conf.DNS
return result.Print()
}