From 078be94fd2387384c758b3a3e220bf3dd50aefbe Mon Sep 17 00:00:00 2001 From: "Matthew R. Kasun" Date: Tue, 8 Mar 2022 17:15:13 -0500 Subject: [PATCH] don't update dns on comms network peer update --- netclient/functions/mqhandlers.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/netclient/functions/mqhandlers.go b/netclient/functions/mqhandlers.go index d8a93c2e..2e57ba84 100644 --- a/netclient/functions/mqhandlers.go +++ b/netclient/functions/mqhandlers.go @@ -9,7 +9,6 @@ import ( "time" mqtt "github.com/eclipse/paho.mqtt.golang" - "github.com/gravitl/netmaker/logger" "github.com/gravitl/netmaker/models" "github.com/gravitl/netmaker/netclient/config" "github.com/gravitl/netmaker/netclient/local" @@ -197,7 +196,11 @@ func UpdatePeers(client mqtt.Client, msg mqtt.Message) { ncutils.Log("error syncing wg after peer update: " + err.Error()) return } - logger.Log(0, "DNS updating /etc/hosts") + //skip dns updates if this is a peer update for comms network + if cfg.Node.NetworkSettings.IsComms == "yes" { + return + } + ncutils.Log("DNS updating /etc/hosts") if cfg.Node.DNSOn == "yes" { if err := setHostDNS(peerUpdate.DNS, ncutils.IsWindows()); err != nil { ncutils.Log("error updating /etc/hosts " + err.Error())