In certain scenarios such as batch rendering, Maya may hang during network name resolution. If this occurs, verify your network settings and make sure that your operating system is capable of resolving localhost to the current machine.
If you are using macOS, refer to the documentation for your OS for information on how to troubleshoot scenarios where macOS cannot resolve localhost.
In general, you can try editing the system file /etc/hosts and updating the line entry:
127.0.0.1 localhost enterHostNameHere
where enterHostNameHere is the name of the host machine, and the output from the macOS command: hostname.