The maximum supported length of a hostname is limited by constant HOSTNAME_LENGTH up to 60 chars and should be increased to 254.
manpage for hostname(7) says:
"Each element of the hostname must be from 1 to 63 characters long and the entire hostname, including the dots, can be at most 253 characters long. Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, and the hyphen . A hostname may not start with a hyphen."