[thelist] PHP: getting domain names from a url - being foiledby.co.uk addresses

Liam Delahunty ldelahunty at britstream.com
Sun Dec 7 16:02:41 CST 2003


Ken Moore Sent: 07 December 2003 00:07
>Tony Crockford wrote:
>>On Sat, 06 Dec 2003 13:21:46 -0700, Ken Moore wrote:
>>here's some of the trickier ones:
>>.co.uk
>>.org.uk
> ...snip...
>>
>>couldn't you do a DNS look up and store the IP address instead?
>>
>>http://uk.php.net/manual/en/function.gethostbyname.php
>
>Of course you are right. These examples were not amoung the given ones. But
>that avoids the valid point brought up by you. And this will be more true
as
>DNS's become more diverse and less predictable. Your solution seems better.
>Do a look up, get the IP address and then do a reverse look up to get the
>DNS.

[ fly>ointment ]

But many domains use shared IP addresses so you'd get a different domain
returned.

egg,
 www.corx.co.uk  will return 217.158.13.39
that IP will return www.britstream.com

Kind regards,
Liam Delahunty,
Mega Products Limited



More information about the thelist mailing list