#2018 Change hostname length limit to 64
Closed: fixed by frenaud. Opened 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

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

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

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

Issue linked to Bugzilla: Bug 1703564

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

master:

  • 6662e99e173a16059271528e1fa58e37a3028924 Add knob to limit hostname length

ipa-4-7:

  • 319b920e19bafab9e2c1555969c11bbf133707e6 Add knob to limit hostname length

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

master:

  • 8ce0e6bf6065e8d08cee7e924eda05174d26d883 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:

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

ipa-4-8:

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