Add custom hostname function. Add autofill for tenant ip

Change-Id: Id3a875b414faa050c01fa2468b8be383c3081cab