Max length of host name in URL? [Archive] - Glock Talk

PDA

View Full Version : Max length of host name in URL?


Jack Straight
12-16-2005, 11:08
Is there a max length of the hostname part of a URL?

http://how-big-can-this-field-be/dir/file.html

If so, I'm sure it is in some standard, but it would take a day to find out. Anyone know off the top of their head?

thanks

9mm Luger
12-16-2005, 11:14
to my knowledge no. I've seen some lengthy URLs.

grokdesigns
12-16-2005, 12:24
Although the specification of the HTTP protocol does not specify any maximum length, the practical limit is 2,083 characters, with no more than 2,048 characters in the path portion of the URL. These are the restrictions currently enforced by Microsoft Interet Explorer, which is still used by a sizeable majority of all users. A reasonable upper limit on the length of URLs has always been imposed by major web browsers. When you wish to submit a form containing many fields, which would otherwise produce a very long URL, the standard solution is to use the POST method rather than the GET method:

Taken from: http://www.boutell.com/newfaq/misc/urllength.html

David_G17
12-17-2005, 08:54
http://3.141592653589793238462643383279502884197169399375105820974944592.com

is a long one.

edit: so long that GT's software messes it up (added space after the dot?)

darth_rifle
12-17-2005, 18:14
IIRC, each DNS path component is limited to 63 characters, while the entire FQDN is limited to 255 characters.

As for the length of a complete address (protocol, host, port and path), I have seen Internet Explorer choke on URLs longer than 16384 characters.

- D. Rifle

razol
12-19-2005, 18:25
The domain name limit is 64 characters, but the dot and the TLD (domain suffix) are inculded in that sum. There you can have one more character in a .com (four cahracters for the suffix) than you can in a .info (5 characters). This is more relevant in longer but more obscure TLDs like .museum (7). Practically, I cannot see anyone using a 64 character domain name.

PanamaDave2
12-21-2005, 03:13
http://************

I looked to see if they had any FAQ or mention of character limitations. I did not see any so thought I would perform a quick test to see if they had any limits. Doesn't seem to be any limitation as I tested w/ 17,775 characters resulting in a 24 character url.

=============================
TinyURL was created!
The following URL: "Deleted for post brevity"
has a length of 17775 characters and resulted in the following TinyURL which has a length of 24 characters:
http://************/cla2g

darth_rifle
12-21-2005, 09:14
Originally posted by PanamaDave2
http://************

I looked to see if they had any FAQ or mention of character limitations. I did not see any so thought I would perform a quick test to see if they had any limits. Doesn't seem to be any limitation as I tested w/ 17,775 characters resulting in a 24 character url.

=============================
TinyURL was created!
The following URL: "Deleted for post brevity"
has a length of 17775 characters and resulted in the following TinyURL which has a length of 24 characters:
http://************/cla2g

Safari 2.0.2 couldn't handle it (Mac OS X 10.4.3).

All ************ does is send out a "Location:" header that causes the browser to load the real page, so I wouldn't think ************ would impose any serious restriction regarding length that a browser would support. Seeing how they're using PHP and probably MySQL for the database they're most likely using a TEXT field that supports strings up to 65536 characters in length to hold the "real" URL -- far in excess of what the HTTP specification allows for a "GET" operation.

- D. Rifle