Use new Network.are_host_same() equivalency check

Replace the existing "is localhost" checks with the new, more reliable method.