Fix the bug where hostnames are always unknown