diff --git a/internal/config/config.go b/internal/config/config.go index 1c7cb2d..012bd8c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,4 +35,5 @@ type Config struct { AwarenessGroups awarenessgroups.Decoder `defailt:"" desc:"Awareness groups for mutually aware NSEs" split_words:"true"` LogLevel string `default:"INFO" desc:"Log level" split_words:"true"` OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"` + LocalDNSServerEnabled bool `default:"true" desc:"Local DNS Server enabled/disabled"` } diff --git a/main.go b/main.go index 6bfaf96..7b69182 100644 --- a/main.go +++ b/main.go @@ -246,7 +246,7 @@ func main() { // This is a bug in istio-proxy and we need to workaround it for now. // NOTE: The /etc/resolv.conf would contain two nameservers only momentarily until the cmd-nsc sidecar // overwrites it. - if initDnsConfig { + if rootConf.LocalDNSServerEnabled && initDnsConfig { // Copy the original resolv.conf to the backup directory so that the cmd-nsc sidecar can // read from the backup and initialize its data structures related to dns resolution. storeResolvConfigFile := "/etc/nsm-dns-config/resolv.conf.restore"