Add hostname validator

Change-Id: Ic735aec1e667d821e2b1aac552ce7731d867accd
Merge "Add hostname validator" into release-0.1