# Curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused

**URL:** <https://discuss.elastic.co/t/curl-7-failed-to-connect-to-xn-localhost-499d-port-9200-connection-refused/38253>\
**Category:** Elasticsearch\
**Created:** [January 2, 2016, 5:09am UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-xn-localhost-499d-port-9200-connection-refused/38253 "2016-01-02T05:09:01Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Dilip\_Dwivedi](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@Dilip\_Dwivedi](https://discuss.elastic.co/u/Dilip_Dwivedi)\
**Post date:** [January 6, 2016, 5:03am UTC](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-xn-localhost-499d-port-9200-connection-refused/38253/12 "2016-01-06T05:03:45Z")

</div>

I have reinstalled elasticsearch and getting same error though I tried with publish address .Please find below screen shot of ES started and curl command with output

**ES STARTED**  
dilip@ubuntu:~/Desktop/ELK2/e/bin$ ./elasticsearch --node.name Dilip  
[2016-01-05 20:57:12,926][INFO][node] [Dilip] version[1.7.3], pid[2584], build[05d4530/2015-10-15T09:14:17Z]  
[2016-01-05 20:57:12,927][INFO][node] [Dilip] initializing ...  
[2016-01-05 20:57:13,232][INFO][plugins] [Dilip] loaded [], sites []  
[2016-01-05 20:57:13,484][INFO][env] [Dilip] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable\_space [13.3gb], net total\_space [18.5gb], types [ext4]  
[2016-01-05 20:57:20,823][INFO][node] [Dilip] initialized  
[2016-01-05 20:57:20,824][INFO][node] [Dilip] starting ...  
[2016-01-05 20:57:21,165][INFO][transport] [Dilip] bound\_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish\_address {inet[/192.168.161.138:9300]}  
[2016-01-05 20:57:21,271][INFO][discovery] [Dilip] elasticsearch/2uXlZQr6QKGSr4PweqeHJA  
[2016-01-05 20:57:25,132][INFO][cluster.service] [Dilip] new\_master [Dilip][2uXlZQr6QKGSr4PweqeHJA][ubuntu][inet[/192.168.161.138:9300]], reason: zen-disco-join (elected\_as\_master)  
[2016-01-05 20:57:25,333][INFO][http] [Dilip] bound\_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish\_address {inet[/192.168.161.138:9200]}  
[2016-01-05 20:57:25,336][INFO][node] [Dilip] started  
[2016-01-05 20:57:25,477][INFO][gateway] [Dilip] recovered [0] indices into cluster\_state

**CURL COMMAND**  
/Desktop/ELK2/e/bin$ curl ‘localhost:9200/\_cat/nodes?v’  
curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused  
dilip@ubuntu:~/Desktop/ELK2/e/bin$ curl ‘192.168.161.138:9200/\_cat/nodes?v’  
curl: (7) Failed to connect to xn--192-mo0a.168.161.138 port 9200: Connection refused

---

_[View the full topic](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-xn-localhost-499d-port-9200-connection-refused/38253)._
