create a Hostname validator

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
tests for the new hostname validator

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
patch socket on tests that call cli directly
use the new hostname validator

Signed-off-by: Alfredo Deza <alfredo@deza.pe>