PDA

View Full Version : Little Question about Second Level Domains


markus
01-07-2005, 08:48 AM
I don't know where to ask this question. Sorry if I'm breaking any rules. I've been trying to search on several RFCs without success.

Motivation:

I wrote a little PHP program to collect information (and then create simple statistics) about HTTP referers. I added some basic verifications to what is being passed in the HTTP headers, to prevent SQL injection, etc.

According to RFCs 1034 and 1035, the maximum length for a domain name is 255, a domain label must only contain alphanumeric chars or hyphens (but it must begin with a letter and it can't be finnished with a hyphen), its maximum legth is 63. However, I would like to extend these verifications to perform some semantical checks. For instance, I've the idea to verify top level domains, so they should be one of a known list of strings (com, edu, gov, org, mil, info, museum, name, uk, ca, etc, etc, etc.).

I'll try to also deal with IDNs (Internationalized Domain Names, RFC3490, etc), but this is another subject.


Here's my problem:

Some top level domains for countries use a second level domain which is somehow generic. For instance: co.uk

I'm wondering if there are any rules (RFC) that affect that kind of second level domains?

Maybe someone here could point me in the right direction.


Thanks a lot for any suggestion you may provide :-)

jlasman
01-07-2005, 07:22 PM
Anything is ontopic in an offtopic forum :) .

The answer is that the folk responsible for the top-level domain get to decide whatever they want under that domain. It's theirs.

Look at ".name" for example.

Or what ".us" used to look like before it became commercial.

Unfortunately I can't remember where I found it; probably in an ancient O'Reilly Internet tome.

And I'm sure it's in the RFCs, but I have no idea where.

Jeff

markus
01-07-2005, 10:09 PM
Thanks for the comments. Much appreciated. :)

I have not found any RFC about this, but I've found this site:
http://www.mattsscripts.co.uk/mwhois.htm

This is whois client written in perl and php (2 different versions), released under GNU GPL v2. And it comes with this nice file:
http://www.mattsscripts.co.uk/servers.lst


So, I believe that will help me a lot. :)