Use ControlD Public DNS when non-available

This logic was missed when new initializing OS resolver logic was
implemented. While at it, also adding this test case to prevent
regression.
This commit is contained in:
Cuong Manh Le
2024-12-11 14:10:55 +07:00
committed by Cuong Manh Le
parent a9f76322bd
commit f5ba8be182
2 changed files with 11 additions and 1 deletions
+3
View File
@@ -118,6 +118,9 @@ func initializeOsResolver(servers []string) []string {
} else {
or.lanServers.Store(&lanNss)
}
if len(publicNss) == 0 {
publicNss = append(publicNss, controldPublicDnsWithPort)
}
or.publicServers.Store(&publicNss)
return slices.Concat(lanNss, publicNss)
}