Per caso ho trovato questa funzione, forse fa al caso tuo:

gethostbyaddr()