Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what's a valid domain name?

99 views
Skip to first unread message

p...@mail.nsbeta.info

unread,
Jan 28, 2011, 8:46:13 PM1/28/11
to bind-users
I googled and found this:

* A domain name can be up to 63 characters long plus a dot plus the
characters used to identify the top-level domain (i.e "com", "info", "biz",
etc.
* Valid characters in a domain name include letters, numbers and
hyphens "-". The domain name must start and end with a letter or number.


So, for this domain name of
"www.xyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy.com"
whose size is larger than 64, is not a valid domain name?

And is there a RFC item for a valid domain name?

Regards.

Barry Margolin

unread,
Jan 28, 2011, 11:20:15 PM1/28/11
to comp-protoc...@isc.org
In article <mailman.1559.129626...@lists.isc.org>,
p...@mail.nsbeta.info wrote:

> I googled and found this:

It's on the Internet, so it must be true. :)

RFC 1035 section 3.1 says: "To simplify implementations, the total
length of a domain name (i.e., label octets and label length octets) is
restricted to 255 octets or less."

The length of each label within a domain name is limited to 63
characters.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***

p...@mail.nsbeta.info

unread,
Jan 29, 2011, 12:30:51 AM1/29/11
to Barry Margolin, comp-protoc...@isc.org
Barry Margolin writes:

>> I googled and found this:
>

> It's on the Internet, so it must be true. :)
>
>>

> RFC 1035 section 3.1 says: "To simplify implementations, the total
> length of a domain name (i.e., label octets and label length octets) is
> restricted to 255 octets or less."
>
> The length of each label within a domain name is limited to 63
> characters.
>

Thanks for the kind info.

Regards.

Mark Andrews

unread,
Jan 29, 2011, 9:37:49 AM1/29/11
to p...@mail.nsbeta.info, comp-protoc...@isc.org, Barry Margolin

In message <201101290530...@mail.nsbeta.info>, p...@mail.nsbeta.info w
rites:

> Barry Margolin writes:
>
> > In article <mailman.1559.129626...@lists.isc.org>,
> > p...@mail.nsbeta.info wrote:
> >
> >> I googled and found this:
> >
> > It's on the Internet, so it must be true. :)
> >
> >>
> > RFC 1035 section 3.1 says: "To simplify implementations, the total
> > length of a domain name (i.e., label octets and label length octets) is
> > restricted to 255 octets or less."
> >
> > The length of each label within a domain name is limited to 63
> > characters.
> >
>
> Thanks for the kind info.

Remember domain names are not the same things as hostnames. Hostnames
are limited to letter digit hyphen (LDH). Other domain names are not
limited and things last SRV records deliberately use labels that are
not legal in hostnames to prevent collisions of the two namespaces when
they are stored in the DNS.


> Regards.
> _______________________________________________
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org

Joseph S D Yao

unread,
Jan 29, 2011, 6:45:42 PM1/29/11
to p...@mail.nsbeta.info, bind-users
As noted before, RFC 1035 set some specifications. But there were a
number of clarifications and changes, notably RFC 1123 and RFC 2181.

So, Pyh, your quote is not quite correct today. The first part never
was - it only refers to second-level domains. The second part is
correct for hostnames only.

RFC 1035:

<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]

<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52 alphabetic characters A through Z in
upper case and a through z in lower case

<digit> ::= any one of the ten digits 0 through 9

Note that while upper and lower case letters are allowed in domain
names, no significance is attached to the case. That is, two names with
the same spelling but different case are to be treated as if identical.

The labels must follow the rules for ARPANET host names. They must
start with a letter, end with a letter or digit, and have as interior
characters only letters, digits, and hyphen. There are also some
restrictions on the length. Labels must be 63 characters or less.

[Joe note: but see RFC 1123 below.]

RFC 1123:

2.1 Host Names and Numbers

The syntax of a legal Internet host name was specified in RFC-952
[DNS:4]. One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.

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

RFC 2181:

11. Name syntax

Occasionally it is assumed that the Domain Name System serves only
the purpose of mapping Internet host names to data, and mapping
Internet addresses to host names. This is not correct, the DNS is a
general (if somewhat limited) hierarchical database, and can store
almost any kind of data, for almost any purpose.

The DNS itself places only one restriction on the particular labels
that can be used to identify resource records. That one restriction
relates to the length of the label and the full name. The length of
any one label is limited to between 1 and 63 octets. A full domain
name is limited to 255 octets (including the separators). The zero
length full name is defined as representing the root of the DNS tree,
and is typically written and displayed as ".". Those restrictions
aside, any binary string whatever can be used as the label of any
resource record. Similarly, any binary string can serve as the value
of any record that includes a domain name as some or all of its value
(SOA, NS, MX, PTR, CNAME, and any others that may be added).
Implementations of the DNS protocols must not place any restrictions
on the labels that can be used. In particular, DNS servers must not
refuse to serve a zone because it contains labels that might not be
acceptable to some DNS client programs. A DNS server may be
configurable to issue warnings when loading, or even to refuse to
load, a primary zone containing labels that might be considered
questionable, however this should not happen by default.

Note however, that the various applications that make use of DNS data
can have restrictions imposed on what particular values are
acceptable in their environment. For example, that any binary label
can have an MX record does not imply that any binary name can be used
as the host part of an e-mail address. Clients of the DNS can impose
whatever restrictions are appropriate to their circumstances on the
values they use as keys for DNS lookup requests, and on the values
returned by the DNS. If the client has such restrictions, it is
solely responsible for validating the data from the DNS to ensure
that it conforms before it makes any use of that data.

See also [RFC1123] section 6.1.3.5.

[Joe note: I think the section number is incorrect.]


--
/*********************************************************************\
**
** Joe Yao js...@tux.org - Joseph S. D. Yao
**
\*********************************************************************/

p...@mail.nsbeta.info

unread,
Jan 29, 2011, 8:32:41 PM1/29/11
to Mark Andrews, comp-protoc...@isc.org, Barry Margolin
Mark Andrews writes:
>
> Remember domain names are not the same things as hostnames. Hostnames
> are limited to letter digit hyphen (LDH). Other domain names are not
> limited and things last SRV records deliberately use labels that are
> not legal in hostnames to prevent collisions of the two namespaces when
> they are stored in the DNS.
>

Could you show an example for the difference between a hostname and a
domain name?

Thanks again.

Regards.

p...@mail.nsbeta.info

unread,
Jan 29, 2011, 8:40:51 PM1/29/11
to Joseph S D Yao, bind-users
Joseph S D Yao writes:

>
> The labels must follow the rules for ARPANET host names. They must
> start with a letter, end with a letter or digit, and have as interior
> characters only letters, digits, and hyphen. There are also some
> restrictions on the length. Labels must be 63 characters or less.
>

A label must start with a letter? oh I don't think so.
How about these domains which all have huge DNS traffic?

163.com
126.com
51.com
56.com

yes 163.com is a domain name but "163" also can be treated as a label for
domain "com.", is it?

Thanks.

Regards.

Mark Andrews

unread,
Jan 30, 2011, 12:50:45 AM1/30/11
to p...@mail.nsbeta.info, comp-protoc...@isc.org, Barry Margolin

In message <201101300132...@mail.nsbeta.info>, p...@mail.nsbeta.info wri
tes:

_http._srv.example.com is not a hostname but is a domain name.
example.com is a hostname and a domain name.

> Thanks again.
>
> Regards.

p...@mail.nsbeta.info

unread,
Jan 30, 2011, 7:30:08 AM1/30/11
to bind-users

From RFC 1123

One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.


p...@mail.nsbeta.info writes:

Chris Buxton

unread,
Jan 30, 2011, 1:09:40 PM1/30/11
to p...@mail.nsbeta.info, Joseph S D Yao, bind-users
Correct, the requirement to start with a letter was removed ages ago.
Witness 3com.com, which may have been the first.

Chris Buxton
BlueCat Networks


On 1/29/11, p...@mail.nsbeta.info <p...@mail.nsbeta.info> wrote:
> Joseph S D Yao writes:
>
>>
>> The labels must follow the rules for ARPANET host names. They must
>> start with a letter, end with a letter or digit, and have as interior
>> characters only letters, digits, and hyphen. There are also some
>> restrictions on the length. Labels must be 63 characters or less.
>>
>
> A label must start with a letter? oh I don't think so.
> How about these domains which all have huge DNS traffic?
>
> 163.com
> 126.com
> 51.com
> 56.com
>
> yes 163.com is a domain name but "163" also can be treated as a label for
> domain "com.", is it?
>
> Thanks.
>
> Regards.
> _______________________________________________
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
>

--
Sent from my mobile device

Barry Margolin

unread,
Jan 30, 2011, 4:28:00 PM1/30/11
to comp-protoc...@isc.org
In article <mailman.1583.129641...@lists.isc.org>,
Chris Buxton <chris.p...@gmail.com> wrote:

> Correct, the requirement to start with a letter was removed ages ago.
> Witness 3com.com, which may have been the first.

Yes, I'm pretty sure they were the impetus for the change, paving the
way for 1-800-FLOWERS.COM years later.

Vytautas Grigaliunas

unread,
Jan 30, 2011, 4:47:16 PM1/30/11
to comp-protoc...@isc.org
What is the status of "dotted" hostnames - i.e. a period in the hostname portion of a domain name ?

At one point they were allowed, I believe ? What is the latest official RFC ?

Thanks...

Vyto

----- Original Message -----
From: Barry Margolin <bar...@alum.mit.edu>
Date: Sunday, January 30, 2011 3:34 pm
Subject: Re: what's a valid domain name?
To: comp-protoc...@isc.org


> In article <mailman.1583.129641...@lists.isc.org>,
> Chris Buxton <chris.p...@gmail.com> wrote:
>

> > Correct, the requirement to start with a letter was removed ages ago.
> > Witness 3com.com, which may have been the first.
>

> Yes, I'm pretty sure they were the impetus for the change, paving the
>
> way for 1-800-FLOWERS.COM years later.
>
> --
> Barry Margolin, bar...@alum.mit.edu
> Arlington, MA
> *** PLEASE don't copy me on replies, I'll read them in the group ***

Barry Margolin

unread,
Jan 30, 2011, 5:13:39 PM1/30/11
to comp-protoc...@isc.org
In article <mailman.1586.129642...@lists.isc.org>,
Vytautas Grigaliunas <vy...@fnal.gov> wrote:

> What is the status of "dotted" hostnames - i.e. a period in the hostname
> portion of a domain name ?
>
> At one point they were allowed, I believe ? What is the latest official RFC ?

I don't think they've every been allowed. Why would you need to do
this, instead of just using another level of subdomain? To get a
literal period into a label, you need to escape it, e.g.
foo\.bar.company.com instead of foo.bar.company.com. The latter is
allowed, always has been, and is quite common.

Chris Buxton

unread,
Jan 30, 2011, 5:18:21 PM1/30/11
to Vytautas Grigaliunas, Bind Users Mailing List

On Jan 30, 2011, at 1:47 PM, Vytautas Grigaliunas wrote:

> What is the status of "dotted" hostnames - i.e. a period in the hostname portion of a domain name ?
>
> At one point they were allowed, I believe ? What is the latest official RFC ?

Periods, or dots, act as dividers in a domain name, separating the various labels. You may have a 'dotted host' in any zone you control. For example, if you control example.com, then some.host.example.com is a valid record name within that zone, as long as host.example.com is not delegated as a subzone.

Chris Buxton
BlueCat Networks

Vyto Grigaliunas

unread,
Jan 31, 2011, 10:50:10 AM1/31/11
to comp-protoc...@isc.org
Although we're moving away from it, we found it useful for naming router
interfaces, i.e. te1-2.routername.company.com, without having to create a
separate sub-domain for each router.

I thought at some point periods were allowed in hostnames, and they do work
without escaping them.

Thanks...

Vyto

> -----Original Message-----
> From: bind-users-bounces+vyto=fnal...@lists.isc.org [mailto:bind-
> users-bounces+vyto=fnal...@lists.isc.org] On Behalf Of Barry Margolin
> Sent: Sunday, January 30, 2011 4:14 PM
> To: comp-protoc...@isc.org
> Subject: Re: what's a valid domain name?
>

> In article <mailman.1586.129642...@lists.isc.org>,
> Vytautas Grigaliunas <vy...@fnal.gov> wrote:
>

> > What is the status of "dotted" hostnames - i.e. a period in the
> hostname
> > portion of a domain name ?
> >
> > At one point they were allowed, I believe ? What is the latest
> official RFC ?
>

> I don't think they've every been allowed. Why would you need to do
> this, instead of just using another level of subdomain? To get a
> literal period into a label, you need to escape it, e.g.
> foo\.bar.company.com instead of foo.bar.company.com. The latter is
> allowed, always has been, and is quite common.
>

Ben Croswell

unread,
Jan 31, 2011, 11:36:22 AM1/31/11
to vy...@fnal.gov, comp-protoc...@isc.org

In that case technically you are creating undelegated subdomains for each router.
The dot is a delimiter and can't be part of a hostname.

-Ben Croswell

On Jan 31, 2011 11:19 AM, "Vyto Grigaliunas" <vy...@fnal.gov> wrote:

Kevin Darcy

unread,
Jan 31, 2011, 6:00:05 PM1/31/11
to bind-...@lists.isc.org
Vyto,
"Dotted hostnames" is a term coined by certain limited
DNS-management tools that strive to split up fully-qualified DNS names
into a "hostname" part and a "zone" (sometimes referred to as "domain")
part. If one chooses to extend a given name for 2 or more labels below
the closest-enclosing zone cut, then in the standard representation used
by those tools, the "hostname" portion of the name will have a dot in
it, hence "dotted hostnames", which are treated by such limited tools as
somehow weird and special. At least one tool I'm familiar with, requires
a special non-default option setting to even allow "dotted hostnames" to
exist at all in its database.

DNS itself has never had a problem with multiple labels beneath a zone
cut. Better tools recognize the inherent flexibility of DNS naming and
don't try to deprecate or otherwise discourage so-called "dotted hostnames".



- Kevin

On 1/31/2011 10:50 AM, Vyto Grigaliunas wrote:
> Although we're moving away from it, we found it useful for naming router
> interfaces, i.e. te1-2.routername.company.com, without having to create a
> separate sub-domain for each router.
>
> I thought at some point periods were allowed in hostnames, and they do work
> without escaping them.
>
> Thanks...
>
> Vyto
>
>
>
>> -----Original Message-----
>> From: bind-users-bounces+vyto=fnal...@lists.isc.org [mailto:bind-
>> users-bounces+vyto=fnal...@lists.isc.org] On Behalf Of Barry Margolin
>> Sent: Sunday, January 30, 2011 4:14 PM
>> To: comp-protoc...@isc.org

>> Subject: Re: what's a valid domain name?
>>

>> In article<mailman.1586.129642...@lists.isc.org>,
>> Vytautas Grigaliunas<vy...@fnal.gov> wrote:
>>

>>> What is the status of "dotted" hostnames - i.e. a period in the
>> hostname
>>> portion of a domain name ?
>>>
>>> At one point they were allowed, I believe ? What is the latest
>> official RFC ?
>>

>> I don't think they've every been allowed. Why would you need to do
>> this, instead of just using another level of subdomain? To get a
>> literal period into a label, you need to escape it, e.g.
>> foo\.bar.company.com instead of foo.bar.company.com. The latter is
>> allowed, always has been, and is quite common.
>>

p...@mail.nsbeta.info

unread,
Jan 31, 2011, 8:54:16 PM1/31/11
to Ben Croswell, comp-protoc...@isc.org
Ben Croswell writes:

> In that case technically you are creating undelegated subdomains for each
> router.
> The dot is a delimiter and can't be part of a hostname.
>

I was thinking you are wrong.
Period is somewhat permitted in a hostname.

From RFC 952

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".

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 [Relaxed in RFC 1123] . The
last character must not be a minus sign or period.


regrads.

Barry Margolin

unread,
Jan 31, 2011, 9:29:02 PM1/31/11
to comp-protoc...@isc.org
In article <mailman.1593.129648...@lists.isc.org>,
Vyto Grigaliunas <vy...@fnal.gov> wrote:

> Although we're moving away from it, we found it useful for naming router
> interfaces, i.e. te1-2.routername.company.com, without having to create a
> separate sub-domain for each router.
>
> I thought at some point periods were allowed in hostnames, and they do work
> without escaping them.

I think you're confusing subdomain and subzone. You can have subdomains
without having subzones. E.g. in the company.com zone file, you can put:

te1-2.routername IN A 1.2.3.4

Ben Croswell

unread,
Jan 31, 2011, 10:06:49 PM1/31/11
to p...@mail.nsbeta.info, comp-protoc...@isc.org

The rfc you quote clearly states when used as a delimiter of a domain as I stated.

-Ben Croswell

Joseph S D Yao

unread,
Feb 1, 2011, 4:14:26 PM2/1/11
to p...@mail.nsbeta.info, bind-users
On Sun, Jan 30, 2011 at 09:40:51AM +0800, p...@mail.nsbeta.info wrote:
> Joseph S D Yao writes:
>
> >
> > The labels must follow the rules for ARPANET host names. They must
> > start with a letter, end with a letter or digit, and have as interior
> > characters only letters, digits, and hyphen. There are also some
> > restrictions on the length. Labels must be 63 characters or less.
> >
>
> A label must start with a letter? oh I don't think so.
> How about these domains which all have huge DNS traffic?
>
> 163.com
> 126.com
> 51.com
> 56.com
>
> yes 163.com is a domain name but "163" also can be treated as a label for
> domain "com.", is it?


That's why I said it was modified later. Did you read the whole
message I wrote?

I spent hours slaving over a hot bit-griddle just to make it for you.

John Wobus

unread,
Feb 4, 2011, 11:26:08 AM2/4/11
to bind-users
So 10.14.22.11 is a legal hostname, right?

We had a recent experience where our DNS administration
system allowed someone to insert in a CNAME record that
resembled this:

www.example.com. CNAME 10.14.22.11.

A fascinating thing about this is that my computer/browser could
take me to www.example.com just fine.

John Wobus
Cornell

On Jan 30, 2011, at 7:30 AM, p...@mail.nsbeta.info wrote:

>
> From RFC 1123
>
> One aspect of host name syntax is hereby changed: the
> restriction on the first character is relaxed to allow either a
> letter or a digit. Host software MUST support this more
> liberal
> syntax.
>
>
>
>
> p...@mail.nsbeta.info writes:
>

>> Joseph S D Yao writes:
>>
>>>
>>> The labels must follow the rules for ARPANET host names. They must
>>> start with a letter, end with a letter or digit, and have as
>>> interior
>>> characters only letters, digits, and hyphen. There are also some
>>> restrictions on the length. Labels must be 63 characters or less.
>>>
>>
>> A label must start with a letter? oh I don't think so.
>> How about these domains which all have huge DNS traffic?
>>
>> 163.com
>> 126.com
>> 51.com
>> 56.com
>>
>> yes 163.com is a domain name but "163" also can be treated as a
>> label for
>> domain "com.", is it?
>>

>> Thanks.
>>
>> Regards.

John Wobus

unread,
Feb 4, 2011, 11:35:42 AM2/4/11
to bind-users
To add to the story, I added a rule to our DNS administration
system that we'll only allow hostnames that include
at least one alphabetic.

John

Joseph S D Yao

unread,
Feb 4, 2011, 2:01:16 PM2/4/11
to John Wobus, bind-users
On Fri, Feb 04, 2011 at 11:26:08AM -0500, John Wobus wrote:
> So 10.14.22.11 is a legal hostname, right?
>
> We had a recent experience where our DNS administration
> system allowed someone to insert in a CNAME record that
> resembled this:
>
> www.example.com. CNAME 10.14.22.11.
>
> A fascinating thing about this is that my computer/browser could
> take me to www.example.com just fine.


I'm guessing that someone stuck records like:

10.14.22.11 A 10.14.22.11

in your system at Cornell? Otherwise, normally, the CNAME record above
would cause errors (i.e., if "10.14.22.11" were not a name, as well).

You can't check this with 'nslookup' - you need to use 'dig'. [Nobody
need respond with the well-known merits and failings of 'nslookup'.]

0 new messages