Error using hostname as IP when starting up notebook

On the old version I have working of Jupyter, I was able run notebook using

jupyter notebook --ip=$HOSTNAME

When I run notebook after doing a new install in a new conda env, I get an error

socket.gaierror: [Errno -8]: Servname not supported for ai_socketype.

Is this a compatibility issue between tornado and Jupyter? Or is there a way to use hostname?

These are the installed versions:

IPython 8.26.0
ipykernel 6.29.5
ipywidgets 8.1.2
Jupiter_client 8.6.2
Jupiter_core 5.7.2
Jupiter_server 2.14.2
jupyterlab 4.2.4
nbclient 0.10.0
nbconvert 7.16.4
nbformat 5.10.4
notebook 7.0.0
qtconsole 5.5.1
tartlets 5.14.3

and

tornado 6.4.1