165 reputation
4
bio website BlackMesh.com
location
age
visits member for 3 years, 6 months
seen yesterday

Director of Emerging Technology at BlackMesh Managed Hosting, longtime Linux aficionado, sometime Drupal developer (and d.o sysadmin), and occasional filesystem tinkerer.


Jul
28
comment Script or tool to get the IP address of a remote host
I'm not sure I understand your meaning. The snippet you provided explicitly queries both A and AAAA, so it's IPv6-aware. I agree insofar as your assertion that you share functionality with the original, but I think that the goal is to improve on what was in the question, not merely to parrot its shortcomings.
Jul
9
comment Script or tool to get the IP address of a remote host
Most stacks prefer IPv6, if available; consequently, you probably want tail -n 1 at the top level, as well, if you want to mirror the host's resolve order. Then again, this whole approach also doesn't respect NIS, or /etc/hosts, or nsswitch.conf, and yet I use it regularly nonetheless on machines where resolveip -s isn't necessarily available, so perhaps I'm being a bit too pedantic. ;)