Short and simple:
Or even shorter:perl -MSocket -E'say inet_ntoa "".gethostbyname shift' domain
Or if you want one line of Perl as opposed to a one-liner,gethost domain
say gethost($host);
Writing program gethost and/or function gethost is left to you.
In reply to Re: gethostbyname one-liner: Improvements?
by ikegami
in thread gethostbyname one-liner: Improvements?
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |