APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds RSS Feeds











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
->
-> Length of a domain name


Length of a domain name


2013/08/05






If you Google for "longest domain name" you'll find a lot of conflicting information. For example, you'll probably find more than a few sites that say that a domain name cannot be more than 63 characters. That's sort of true and sort of untrue, but to understand why takes some digging (figuratively and literally, as you'll see).

It gets pretty ridiculous. For example, at one time someone registered this silliness:

http://www.thelongestdomainnameintheworldandthenso
meandthensomemoreandmore.andyoucanaddsomemoretotha
taswell.andabitmore.andwhynotgoonabit.aboutwatneys
redbarrel.andalizardinthebleedingbidet.andnothingt
oeatexcept.britishairwayssandwiches.etcetcetcand.theinfo.net/
 

All of that except "www" is a domain name - subdomains of subdomains, all under "theinfo.net". To make things even more confusing, the person could have added another host called "peanuts" (or wahatever) and could have had "www" and "peanuts" served by different websites and most of us would think of www.all the rest and peanuts.all the rest as separate website domains!

Let's just ignore the confusion of website domains, shall we? Trust me, it's bad enough without that. For the moment, let's look at the definition of "domain name".

A domain is identified by a domain name, and consists of that part of the domain name space that is at or below the domain name which specifies the domain. A domain is a subdomain of another domain if it is contained within that domain. This relationship can be tested by seeing if the subdomain's name ends with the containing domain's name. For example, A.B.C.D is a subdomain of B.C.D, C.D, D, and " ".

That's from RFC1034. So, if we want to get pedantic, that "theinfo.net" mess was a subdomain, not a domain. According to the same RFC, each component of a subdomain is limited to 63 characters, so THAT would be the actual limit of a domain name.

Assuming we're just counting characters, of course. What if we get into typography? An "m" is wider than an "i", so a 63 character domain name with a lot of "m"'s in it would be "longer" (wider) than one without.. silly? Sure, but the whole thing is silly, isn't it?

Whoever owns "thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com" (63 characters when you take away ".net" tried to get recognition from Guinness World Records. Guinness responded:

This record is currently rested, which means that no one can attempt this record and become a new record holder. It has been rested because there is no merit whatsoever in this. It takes little to no effort and is similar to taking the largest number in the world and then adding 1 to it.

That's not accurate. You can't just go on adding letters to a domain name and you can't have an infinitely long subdomain. The same RFC plainly says:

To simplify implementations, the total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255.

I didn't explain "label lengths" before. Again, we turn to the RFC:

Internally, programs that manipulate domain names should represent them as sequences of labels, where each label is a length octet followed by an octet string. Because all domain names end at the root, which has a null string for a label, these internal representations can use a length byte of zero to terminate a domain name.

Given that the "theinfo.net" silliness adds up to 242 characters (subtract the "."'s) and has 11 components, that comes to only 253, so there are 2 characters missing somewhere!

Note: the original RFC for hostnames is RFC-952, which says (in part):

A "name" (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.). Note that periods are only allowed when they serve to delimit components of "domain style names". (See RFC-921, "Domain Name System Implementation Schedule", for background). No blank or space characters are permitted as part of a name. No distinction is made between upper and lower case. The first character must be an alpha character. The last character must not be a minus sign or period.

That was modified by RFC-1123 to allow either a letter or a digit as the first character, but underscores are not allowed anywhere in names.

However (there's always a gotcha), that 253 character name might not work everywhere. RFC1123 says that

Host software MUST handle host names of up to 63 characters and SHOULD handle host names of up to 255 characters.

Notice that they are blurring host names and DNS components. That's OK; it's pretty blurry anyway. For example, is "scofaq.aplawrence.com" the host "scofaq" at "aplawrence.com" or might there be a "peanuts.scofaq.aplawrence.com"?

Hard to say, isn't it? One quick check is to ask for an "mx" record. A subdomain doesn't HAVE to have an "mx", but if it does, we know it is a subdomain and not a host.

# dig +short  scofaq.aplawrence.com mx  <- probably host (no answer)
# dig +short google.com  mx  <- domain (returns hosts)
20 alt1.aspmx.l.google.com.
10 aspmx.l.google.com.
30 alt2.aspmx.l.google.com.
50 alt4.aspmx.l.google.com.
40 alt3.aspmx.l.google.com.
# dig +short gmail.com mx  <- domain (returns hosts)
20 alt2.gmail-smtp-in.l.google.com.
5 gmail-smtp-in.l.google.com.
40 alt4.gmail-smtp-in.l.google.com.
30 alt3.gmail-smtp-in.l.google.com.
10 alt1.gmail-smtp-in.l.google.com.
# dig +short mail.google.com  mx <- domain? (returns host, but note no priority) 
googlemail.l.google.com.
# dig +short googlemail.l.google.com mx  <- probably host (no answer)
# dig +short plus.google.com  mx  <- domain (returns hosts)
40 alt3.aspmx.l.google.com.
30 alt2.aspmx.l.google.com.
20 alt1.aspmx.l.google.com.
10 aspmx.l.google.com.
50 alt4.aspmx.l.google.com.
# dig +short code.google.com  mx
code.l.google.com. <- domain (returns host)
 

Back to the contenders for one last look. We have The World's Longest Single Word Domain Name! which perhaps does deserve Guinness as it is a real place name (created for publicity reasons long before the Internet). Although "llanfairpwllgwyngyllgogerychwyrndrobwyll-llantysiliogogogoch" weighs in at only 60 characters, I think it deserves recognition.

Then we have this, which is billed as "The world's longest alphabetical email address":

World's longest alphabetical email address

Remember the "would" and "should" of RFC1123 above? Point taken.




If this page was useful to you, please help others find it:  





Comments?




More Articles by - Find me on Google+



Click here to add your comments
- no registration needed!


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar

Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

I am a Kerio reseller. Articles here related to Kerio products reflect my honest opinion, but I do have an obvious interest in selling those products also.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

pavatar.jpg

This post tagged:

       - Linux
       - MacOSX
       - Microsoft
       - TCP/IP















My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide



Buy Kerio from a dealer
who knows tech:
I sell and support

Kerio Connect Mail server, Control, Workspace and Operator licenses and subscription renewals



Click and enter your name and phone number to call me about Kerio® products right now (Flash required)