If host speciafied by name, not IP set ip to localhost.