snmp_exporter icon indicating copy to clipboard operation
snmp_exporter copied to clipboard

Breaking change in DNS Windows name resolution in last release due to change in [Resolver.PreferGo]

Open JDA88 opened this issue 3 years ago • 0 comments

Some context first:

Most of our target are stored with their short name hostname01 instead of their full DNS name hostname01.site.domain The main reason is that the target are retrieved from our CMDB via scripts and that in our environment the conversion from short name to FQDN is not fully predictable and depend on the site ; It is the “suffix list” in the LAN interface that usually take care of this.

Host operating system: output of uname -a

Windows server

snmp_exporter version: output of snmp_exporter -version

0.21.0

What did you do that produced an error?

Using short DNS name in the target

What did you expect to see?

Same behaviour as 0.20.0

What did you see instead?

Failed to resolve the target

Same issues as in prometheus #11480

Root cause: a change from go1.19:

Resolver.PreferGo is now implemented on Windows and Plan 9. It previously only worked on Unix platforms. Combined with Dialer.Resolver and Resolver.Dial, it's now possible to write portable programs and be in control of all DNS name lookups when dialing.

The net package now has initial support for the netgo build tag on Windows. When used, the package uses the Go DNS client (as used by Resolver.PreferGo) instead of asking Windows for DNS results. The upstream DNS server it discovers from Windows may not yet be correct with complex system network configurations, however.

PS: Due to the nature of the exporter I think it's not a major issue, but just wanted you to know as it's an undocumented change.

JDA88 avatar Dec 15 '22 10:12 JDA88