Friday, February 4, 2011

Turning a Hostname into an IP Address

#!/usr/bin/env python
#Get the IP Address

import socket
hostname = 'maps.google.com'
addr = socket.gethostbyname(hostname)
print 'The address of ', hostname, 'is', addr

2 comments: