Fix hostname resolution: trim to name only.