# File lib/specinfra/command/darwin/base/host.rb, line 23 def get_ipaddress(name) # If the query returns multiple records the most likey match is returned. # Generally this means IPv6 wins over IPv4. %Q{dscacheutil -q host -a name #{escape(name)} | } + %Q{awk '/^ipv6_/{ ip = $2 }; /^$/{ exit }; /^ip_/{ ip = $2; exit}; END{ print ip }'} end