Behavior: DNS resolver search list and options handling in k6 without --dns
0 reputation · 31 Jul 2022, 19:47 UTC
The goal is to determine whether k6, when the `--dns` flag is omitted, applies the search list and resolver options (such as `rotate` and `timeout`) defined in the system’s `/etc/resolv.conf` during hostname lookups initiated by virtual users.
DNS results are cached per VU for the test duration and are not refreshed if the underlying record changes, and the caching mechanism is independent of the system resolver. Observations indicate that the handling of `/etc/resolv.conf` varies across Linux distributions and may have changed in k6 v0.44 when the DNS resolver implementation was updated, leaving the exact behavior unclear.
Does k6 honor the search list from `/etc/resolv.conf` when `--dns` is not set? Does it respect the `rotate` and `timeout` options in that file? How does this behavior differ between k6 versions (e.g., v0.44 and later) and various Linux distributions?