Make the maximum hostname length configurable in the config.

This replaces an offensive amount of inconsistent magic numbers.