b001.example.com has address 192.168.55.121
b001.example.com mail is handled by 0 mail.example.com.
and
host puppet
puppet.example.com is an alias for puppet.b.example.com.
puppet.b.example.com has address 192.168.55.240
This commit makes sure that any lines not containing an IP address are ignored and that only the first IP address is used (if more than one is returned).
host can (and does) return multiple lines, eg:
host b001
b001.example.com has address 192.168.55.121 b001.example.com mail is handled by 0 mail.example.com.
and
host puppet
puppet.example.com is an alias for puppet.b.example.com. puppet.b.example.com has address 192.168.55.240
This commit makes sure that any lines not containing an IP address are ignored and that only the first IP address is used (if more than one is returned).
See also http://github.com/robinbowes/murder/commit/d457e7b0c5555dc0c56ca90ccd36e8813e8f9768 which makes this technique a little more robust by setting the language before running the "host" command.