Per Tony Finch [1], the maximum number of segments are:
I had a quick look and I noticed that it sets the maximum number of labels to 100. The actual maximum is 128, because the maximum length of a DNS name is 255, and the minimum length of a label is 2 (except for the root which is 1), and (255 - 1)/2 + 1 == 128.
https://lobste.rs/s/tukocy/network_protocols_sans_i_o_2016#c_495uaz