What is the maximum length for a fully qualified domain name, including the trailing period?

Which of the following is not one of the elements of the Domain Name System (DNS)?

What is the maximum length for a fully qualified domain name, including the trailing period?

Which of the folowing would be the correct FQDN for a resource record in a reverse lookup zone if the computer's IP address is 10.75.143.88?

In the fully qualified domain name www.sales.contoso.com, which of the following is the second-level domain>

This DNS configuration item will foward DNS queries to different dervers based on the domain name of the query.

The IPv6 DNS host record is referred to as a(n):

A DNS server that hosts a primary or secondary zone containing a particular record can issue the following response to a query for that record:

Data from a primary zone is transmitted to secondary zones using the following:

unread,

May 20, 1998, 3:00:00 PM5/20/98

to

hi,

my eyes are burning from looking thru rfc's. what is maximum length of a
fully qualified domain name? what is limit of the labels(?) within the fqdn?

i thought i interpreted the length of labels could be up to 63 and up to 255
labels in an fqdn? that seems very long.

can someone straighten me out and point me to the correct rfc.

thanks

as always an email cc would be appreciated.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading

Chris van den Berg

unread,

May 22, 1998, 3:00:00 PM5/22/98

to

> my eyes are burning from looking thru rfc's. what is maximum length of a
> fully qualified domain name? what is limit of the labels(?) within the fqdn?

> i thought i interpreted the length of labels could be up to 63 and up to 255
> labels in an fqdn? that seems very long.

Not quite right. I think labels can be 63 octets each, up to 255 octets for a
domain. RFC 2065 says the maximum number of labels in DNS is 127 (but I
couldn't find where this is initially defined).
You can look through, RFC 1034 and 1035, for some of the first hostname
discussions. Otherwise, try RFC 1123, sections 2.1 and 6.1.3.5 for label
and hostname information.
RFC 1912 also has some discussion of host name issues, but it's an
informational RFC, not a defining standard.

Chris

Chris van den Berg
Programmer/Analyst
Communication and Network Services
(510)643-9837
Key fingerprint = 8B 52 10 58 96 40 E8 9A EA 4B E9 27 F2 29 1A A8

Sobald wir an die Moral glauben, verurteilen wir das Dasein.
-Friedrich Nietzsche

unread,

May 23, 1998, 3:00:00 PM5/23/98

to

> hi,


>
> my eyes are burning from looking thru rfc's. what is maximum length of a
> fully qualified domain name? what is limit of the labels(?) within the fqdn?
>
> i thought i interpreted the length of labels could be up to 63 and up to 255
> labels in an fqdn? that seems very long.

The maximum numbet of octets is a label is 63. RFC1035.
The maximum number of octets in a domain name is 255
octets. RFC1035

The maximum length of a fqdn, not a hostname, is 1004 characters.
RFC1035
The maximum length of a full qualified hostname is 253
characters. Imputed from RFC952, RFC1123 and RFC1035.

Mark

>
> can someone straighten me out and point me to the correct rfc.
>
> thanks
>
> as always an email cc would be appreciated.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>

--
Mark Andrews, CSIRO Mathematical and Information Sciences
Locked Bag 17, North Ryde, NSW 1670, Australia.
PHONE: +61 2 9325 3148 INTERNET:
MOBIL: +61 41 442 9884 UUCP:....!uunet!cmis.csiro.au!mark.andrews

(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$)

regex is always going to be at best an approximation for things like this, and rules change over time. the above regex was written with the following in mind and is specific to hostnames-

Hostnames are composed of a series of labels concatenated with dots. Each label is 1 to 63 characters long, and may contain:

  • the ASCII letters a-z (in a case insensitive manner),
  • the digits 0-9,
  • and the hyphen ('-').

Additionally:

  • labels cannot start or end with hyphens (RFC 952)
  • labels can start with numbers (RFC 1123)
  • max length of ascii hostname including dots is 253 characters (not counting trailing dot) (http://blogs.msdn.com/b/oldnewthing/archive/2012/04/12/10292868.aspx)
  • underscores are not allowed in hostnames (but are allowed in other DNS types)

some assumptions:

  • TLD is at least 2 characters and only a-z
  • we want at least 1 level above TLD

results: valid / invalid

  • 911.gov - valid
  • 911 - invalid (no TLD)
  • a-.com - invalid
  • -a.com - invalid
  • a.com - valid
  • a.66 - invalid
  • my_host.com - invalid (undescore)
  • typical-hostname33.whatever.co.uk - valid

EDIT: John Rix provided an alternative hack of the regex to make the specification of a TLD optional:

(?=^.{1,253}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(?<!-))|((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63})$)
  • 911 - valid
  • 911.gov - valid

EDIT 2: someone asked for a version that works in js. the reason it doesn't work in js is because js does not support regex look behind. specifically, the code (?<!-) - which specifies that the previous character cannot be a hyphen.

anyway, here it is rewritten without the lookbehind - a little uglier but not much

(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)

you could likewise make a similar replacement on John Rix's version.

EDIT 3: if you want to allow trailing dots - which is technically allowed:

(?=^.{4,253}\.?$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}\.?$)

I wasn't familiar with trailing dot syntax till @ChaimKut pointed them out and I did some research

  • http://dns-sd.org./TrailingDotsInDomainNames.html
  • https://jdebp.eu./FGA/web-fully-qualified-domain-name.html

Using trailing dots however seems to cause somewhat unpredictable results in the various tools I played with so I would be advise some caution.

What is the character limit on individual domain names and the limit on the fully qualified domain names Fqdns )?

The maximum length of the host name and of the fully qualified domain name (FQDN) is 63 bytes per label and 255 characters per FQDN.

What is the last part of an FQDN called?

The FQDN consists of two parts: the hostname and the domain name. For example, an FQDN for a hypothetical mail server might be mymail.somecollege.edu . The hostname is mymail , and the host is located within the domain somecollege.edu . In this example, .

Which of the following would be the correct FQDN for a resource record in a reverse lookup zone if the computer's IP address is 192.168 1.10 1 point?

D. Correct: PTR records contain the information needed for the server to perform reverse name lookups. 57. Which of the following would be the correct FQDN for a resource record in a reverse lookup zone if the computer's IP address is 10.75.