improve explanatory comment about trailing dots in searches

This commit is contained in:
Fernando Crespo Gravalos 2019-10-04 11:37:48 +02:00 committed by Fernando Crespo Grávalos
parent 0b850c5d82
commit 9dac0c2d02

View File

@ -230,7 +230,7 @@ func parseResolvConf(reader io.Reader) (nameservers []string, searches []string,
}
}
if fields[0] == "search" {
// Strip redundant trailing dot to avoid hitting search validation limits.
// Normalise search fields so the same domain with and without trailing dot will only count once, to avoid hitting search validation limits.
trimTrailingDot := []string{}
for _, s := range fields[1:] {
trimTrailingDot = append(trimTrailingDot, strings.TrimSuffix(s, "."))