1828667 Members
2059 Online
109984 Solutions
New Discussion

getip HP-UX utility

 
Enrico Venturi
Super Advisor

getip HP-UX utility

Hello colleagues,
which is the best Linux utility candidate to replace the HP-UX /usr/bin/getip?

It needs to get the IP address related to a hostname.

regards
enrico
4 REPLIES 4
Ivan Krastev
Honored Contributor

Re: getip HP-UX utility

You can use 'host' in linux.


regards,
ivan
George Liu_4
Trusted Contributor

Re: getip HP-UX utility

host
or
dig
or
nslookup
James R. Ferguson
Acclaimed Contributor

Re: getip HP-UX utility

Hi Enrico:

You can also leverage Perl (having the platform-independent advantage):

# perl -le '($name,$aliases,$addrtype,$length,@addrs)=gethostbyname($ARGV[0]);for $addr (@addrs) {print join ".",unpack "C*",$addr}' www.google.com
64.233.161.147
64.233.161.104
64.233.161.99

Instead of 'www.google'com' pass any host or domain name.

Regards!

...JRF...
Ragu_3
Trusted Contributor

Re: getip HP-UX utility

Use the "dig -a " option, what you need is the A record for your specific host-address. Domain Internet Groper is a comprehensive tool.
Debian GNU/Linux for the Enterprise! Ask HP ...