blackbox_exporter: Hosts gets converted to IP and makes request fail

The blackbox exporter is converting the hostname to IP in the request whilst I would like it to keep the hostname in the request itself. This comes to the fact that there is a proxy validating the request that needs the hostname to properly process it. In my specific case, the request times out.

Is it possible to disable resolving the DNS and to make the request “vanilla”?

Host operating system: output of uname -a

Linux 2c16de9e1e0b 4.4.0-116-generic #140~14.04.1-Ubuntu SMP Fri Feb 16 09:25:20 UTC 2018 x86_64 GNU/Linux

blackbox_exporter version: output of blackbox_exporter -version

0.12.0

What did you expect to see?

ts=2018-03-08T14:05:48.014991379Z caller=http.go:282 module=mymodule target=https://hostname/endpoint level=info msg="Making HTTP request" url=https://hostname/endpoint host=hostname

What did you see instead?

ts=2018-03-08T14:05:48.014991379Z caller=http.go:282 module=mymodule target=https://hostname/endpoint level=info msg="Making HTTP request" url=https://[IPADDRESS]/endpoint host=hostname

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

If you do not implement HTTP proxies in the usual way (by the way, in #264 brought up the exactly same statement “I would never expect an HTTP proxy client to perform DNS resolution (of anything but the proxy’s hostname itself). That’s not how HTTP proxies are supposed to work.”. At least, this is something that must be documented. Neither can I find any statement in the documentation that blackbox exporter is supposed to be used in your local network – something at least I would consider surprising given the feature set.

I might support the idea of ip4/ip6/none. I’m already thinking about implementing ip4-only as part of https://github.com/prometheus/blackbox_exporter/issues/302.

No, this is not possible. The blackbox exporter has to do resolution in order to implement v4/v6 selection logic. I’d suggest probing the backend directly.