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

Paul Bennett paul at teltest.com
Sun Dec 7 19:14:30 CST 2003

Tony Crockford wrote:

> On Sat, 06 Dec 2003 13:21:46 -0700, Ken Moore <psm2713 at hotmail.com> 
> wrote:
>> Not so tricky at all. Assuming that there are a set number of 
>> top-level domains (com, gov, net) and that there is a set number of 
>> characters (".", I think is the only one) that begin the TL name, do 
>> a string processing routine that looks for the "." and the TL domain 
>> such as "com". Take those four characters and all of the ones back to 
>> the "."
> ...
> couldn't you do a DNS look up and store the IP address instead?
> http://uk.php.net/manual/en/function.gethostbyname.php 

just a warning - reverse dns can be s..l..o..w when working through a 
large list of ip's
we had some simple ip-> domain resolving from a db log and it took up to 
7 minutes to chew through the ip's

> Maybe?

	Paul Bennett						
	Internet Developer				
	Teltest Electronic Design		
Email: paul at teltest.com				
Phone: 64 4 237 4557					
Web: http://www.teltest.com		
Wap: http://wap.teltest.com			

More information about the thelist mailing list