Hi
script
Code:

#!/usr/bin/python
import sys
import os
import os.path as path
import socket
import popen2

def main():
hostname = ""
aliases = ""
ipaddrlist = ""
hostname,aliases,ipaddrlist = socket.gethostbyaddr('9.124.36.94')
print 'hostname="%s"' % hostname
print 'aliases="%s"' % aliases
print 'ipaddrlist="%s"' % ipaddrlist

if __name__ == '__main__':
main()


out of the script is

output of the script:

ptcvm5:/home # ./hostname.py
hostname="ptcvm5.in.ibm.com"
aliases="['ptcvm5']"
ipaddrlist="['9.124.36.94']"