I think this is not a usual "hostname not resolved" issue and I don't think this relates to the service I am talking about below:

  1. I have a cluster installed with Anaconda's jupyter notebook, the notebook is up and its port is up. Basically, jupyter notebook is a service running on the host and user accesses it from his or her workstation.
  2. To access the service, user will need to go to http://host:port
  3. On the host, I am able to use http://localhost:port
  4. On the same host, when I try http://host:port, I get rejected with the error: could not connect to host
  5. I am able to ping the host from my workstation and my colleague's workstation.

    So what is wrong here?

    Thank you very much. Any hint is appreciated.

  • Your title is wrong: your error is "could not connect" and not "could not resolve". Your software is probably listening on the wrong network interface. It listens on localhost and hence you can access it through localhost but not through the server name tied to its "true" network interface through its IP address. Dec 6, 2017 at 2:04
  • alright, in your opinion, what/where change should I make? Thanks.
    – PasLeChoix
    Dec 6, 2017 at 3:49
  • @PasLeChoix just as Patrick described. Your notebook instance is not listening on an interface that can be accessed from outside the host itself. See jupyter-notebook.readthedocs.io/en/stable/… especially the c.NotebookApp.ip = '*' part Nov 4, 2021 at 13:27

2 Answers 2


This sort of issue is normally because the service is only configured for local network.

You can check this by entering the following command in a command prompt:

netstat -an 

Check the output for entries with your port number that has a LISTENING entry.

If it is listening on all interfaces it will have a ., or similar, depending on whether it is listening in IPv4 or IPv6, or both modes.

If that is the case, the service will need to be changed to use all interfaces.

  • Thank you. This is what I got: $ netstat -an | grep 8880 tcp 0 0* LISTEN
    – PasLeChoix
    Dec 6, 2017 at 14:37
  • 1
    So your service is only listening on the localhost network. You will need to change the configuration for your service, whatever that is.
    – sweetfa
    Dec 6, 2017 at 21:55

first , please verify the port opening of the server. please telnet from another workstation.

telnet host port

if this is not working run the below command

sudo netstat -upant | grep <port>

there should be a

tcp        0      0<port> *               LISTEN 

if there is a instead of having that is the reason for this behavior

if you can see the or host's IP address check the firewall setting (iptables in linux)

therefore, Please change the configuration of the service to listen for any interface or to that particular interface of the host. check your config , there may be a config for localhost only.

I think this URL will help you for more information:-


  • Thank you and sweetfa for the diagnosis, I do not have root nor sudo, I will have to engage a system admin to do the check, can you please give a detailed command here so I can pass it to sa? our sa only run whatever commands we give them, so I better prepare that. Big thanks
    – PasLeChoix
    Dec 6, 2017 at 12:49
  • actually it my bad , you can run that command without having sudo(netstat -upant | grep <port>).if you can see the or host's IP address check the firewall setting. in that case you have to ask them to check the firewall settings to open that particular port. Dec 6, 2017 at 13:21
  • if your using Iptables you can ask them to run --> iptables -A INPUT -p tcp -m tcp --dport <port> -j ACCEPT. Dec 6, 2017 at 13:25
  • This is what I got: netstat -upant | grep 8880 tcp 0 0* LISTEN 1424/python
    – PasLeChoix
    Dec 6, 2017 at 14:35
  • this is the reason , this service is only listening via your localhost ( . please change the configuration for any IP or your server IP. then it should work. if it's not working you can go for the Iptables or firewall settings. Dec 6, 2017 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.