#2018 Change hostname length limit to 64
Closed: fixed 3 years ago by frenaud. Opened 10 years ago by rcritten.

Linux defines MAXHOSTNAMELEN AS 64, we need to honor that. gethostname(2), unode(2), hostname(1) all enforce this limit.

This is limited now to 255 in the host plugin.


Does it cause any trouble? Can we defer it for now?

Limitations which come from DNS:

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

DNS label = one part of name between two dots, i.e. label1.label2.label3.

See RFC 2181, section 11 Name syntax. http://tools.ietf.org/html/rfc2181#section-11

To be clear: 64 = 63 symbols + terminator

Metadata Update from @rcritten:
- Issue assigned to jcholast
- Issue set to the milestone: Ticket Backlog

5 years ago

Metadata Update from @rcritten:
- Assignee reset
- Issue close_status updated to: None

3 years ago

Metadata Update from @rcritten:
- Custom field on_review reset (from 0)
- Custom field rhbz reset (from 0)

3 years ago

Metadata Update from @rcritten:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1703564

3 years ago

Metadata Update from @rcritten:
- Issue set to the milestone: FreeIPA 4.7.3 (was: Ticket Backlog)

3 years ago

master:

  • 6662e99 Add knob to limit hostname length

ipa-4-7:

  • 319b920 Add knob to limit hostname length

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

master:

  • 8ce0e6b ipatests: add tests for ipa host-add with non-default maxhostnamelength

If you do this then you should add support for setting just the shortname as hostname in the system, otherwise it becomes a nightmare to deal with long domain names and hosts with long names too.

I don't see how the two are related. The Linux length limit on FQDN Is 64. The previous IPA limit was 255 so it was possible to create hostnames in IPA that were illegal in Linux, our primary platform. So the default was reduced but can be easily reconfigured back to what it was as needed.

ipa-4-7:

  • 353062a ipatests: add tests for ipa host-add with non-default maxhostnamelength

ipa-4-8:

  • 4dcd112 ipatests: add tests for ipa host-add with non-default maxhostnamelength

Login to comment on this ticket.

Metadata