mirror of
https://github.com/inspec/inspec
synced 2024-12-18 00:53:22 +00:00
c280e9a816
* Fix host resolution on Darwin, use dig wherever possible The `host` and `dig` commands do not return non-zero if a query returns NXDOMAIN or NOERROR, but the DarwinHostProvider was expecting it when deciding whether to fall back to IPv4 if a IPv6 query failed. Therefore, the `host` resource would not function properly when resolving hostnames on Darwin. The logic has been changed to use `dig` short output and query for both v6 and v4 addresses. Additionally, the LinuxHostProvider has been modified to prefer `dig` if it's available to keep behavior similar between Darwin and Linux whenever possible. This has the added benefit of providing v6 and v4 resolution if possible where `getent hosts` only returns v6 if v6 records exist. Signed-off-by: Adam Leff <adam@leff.co>
3 lines
74 B
Text
3 lines
74 B
Text
some.cname.target
|
|
another.cname.target
|
|
2606:2800:220:1:248:1893:25c8:1946
|