See http://javarevisited.blogspot.com/2011/09/find-hostname-from-ip-address-to.html to learn more ways to get IP address from hostname in UNIX and Linux.
Its common requirement to find IP address from hostname in Windows, Linux or UNIX operating system. Some times you want to know how to get IP address from hostname or sometime just hostname from IP address. Thankfully there are lot of commands in UNIX, Linux and Windows which can be used to get IP address from hostname and vice versa.
In this UNIX, Linux and Windows command tutorial we will see following command examples to get IP address :
5) ipconfig in windows
Important point to note is that these commands return internal IP address, if host is connected via LAN or in case you want to know IP address of localhost. By the way if you want to know external IP address of your computer, assigned by Service provider or ISP than you can go to any site like ipchicken.com which display IP address for your computer.
Related UNIX command tutorials and examples :