Set hostname if attribute present