If I have :
domainA.com/out.php :
Is it possible to ge
Use get_headers() to get the http headers from a URL.
Something like this should work to get the domain name.
$headers = get_headers('http://domaina.com/out.php', 1);
echo $headers['Location'];
To resolve the IP address, look at the gethostbyname() function.
echo gethostbyname($headers['Location']);