support fully qualified domain name in hostnames.

Change-Id: I2bc291cb1bac6a5e355661cfbfc2a1ddadff5576
Merge "support fully qualified domain name in hostnames."