Added support for custom hostname formatting.