Who hosts that site? (a bash alias),

published at 11:09pm on 09/06/11

More than once (especially during the recent AWS outages) I have found myself wondering what network hosts a given web service’s servers. In general, this process has involved my getting the IP address of a particular hostname, and then doing a whois lookup on that IP address to query ARIN to find out which network owns the IP address of that server. This generally gives a pretty good indication of where the server is hosted.

Well that process was getting tedious, so I finally added the following alias to my .bashrc:

whip () { whois `resolveip -s $*`; }

Hereafter, you can type “whip ” (that’s Whois Host IP) to get the network information. Let’s try it out:

$ whip www.foursquare.com
#
# Query terms are ambiguous.  The query is assumed to be:
#     "n 50.16.242.188"
#
# Use "?" to get help.
#

#
# The following results may also be obtained via:
# http://whois.arin.net/rest/nets;q=50.16.242.188?showDetails=true&showARIN=true
#

American Registry for Internet Numbers NET50 (NET-50-0-0-0-0) 50.0.0.0 - 50.255.255.255
Amazon.com, Inc. AMAZON-EC2-8 (NET-50-16-0-0-1) 50.16.0.0 - 50.19.255.255

Looks like Foursquare is hosted on Amazon AWS (which we all know because they’ve fallen victim to some of those recent outages).

Now of course this doesn’t always get you the granular detail you need, but for a quick first pass, this should do the trick.

Filed under: Technology

Leave a Reply: