Unable to telnet to a server

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite












Here are 2 servers



  • 192.168.0.12

  • 192.168.0.21

there is a service running in 50070 port in server 192.168.0.12



when I do telnet from 192.168.0.21 server it fails:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


When I give hostname then also it fails:



$telnet master1.mycluster 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


Even when I try from 192.168.0.12 it fails if I give the IP address:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


But it works if I give the hostname:



$telnet master1.mycluster 50070
Trying 127.0.0.1...
Connected to master1.mycluster.
Escape character is '^]'.


I found this question can not telnet to a server connection refuse, but I tried all the possibilities. These are what I tried:



  1. Turned off iptables in both the servers


  2. Added ALL: ALL in cat /etc/hosts.allow


  3. Made sure that the service is running in that port


But none of these work for me.



Here is my /etc/hosts



127.0.0.1 master1.mycluster master1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.12 master1.mycluster master1
192.168.0.21 slave1.mycluster slave1


Is there anything else that I am missing to make it working ?







share|improve this question

















  • 1




    My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
    – Jeff Schaller
    May 30 at 12:38










  • What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
    – ctrl-alt-delor
    May 30 at 12:56










  • @ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
    – Gerg
    May 30 at 13:19










  • @JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
    – Gerg
    May 30 at 13:21







  • 2




    You are sure the service is running on the public address (192) and not just the local one (127)?
    – Raman Sailopal
    May 30 at 13:48














up vote
-1
down vote

favorite












Here are 2 servers



  • 192.168.0.12

  • 192.168.0.21

there is a service running in 50070 port in server 192.168.0.12



when I do telnet from 192.168.0.21 server it fails:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


When I give hostname then also it fails:



$telnet master1.mycluster 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


Even when I try from 192.168.0.12 it fails if I give the IP address:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


But it works if I give the hostname:



$telnet master1.mycluster 50070
Trying 127.0.0.1...
Connected to master1.mycluster.
Escape character is '^]'.


I found this question can not telnet to a server connection refuse, but I tried all the possibilities. These are what I tried:



  1. Turned off iptables in both the servers


  2. Added ALL: ALL in cat /etc/hosts.allow


  3. Made sure that the service is running in that port


But none of these work for me.



Here is my /etc/hosts



127.0.0.1 master1.mycluster master1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.12 master1.mycluster master1
192.168.0.21 slave1.mycluster slave1


Is there anything else that I am missing to make it working ?







share|improve this question

















  • 1




    My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
    – Jeff Schaller
    May 30 at 12:38










  • What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
    – ctrl-alt-delor
    May 30 at 12:56










  • @ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
    – Gerg
    May 30 at 13:19










  • @JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
    – Gerg
    May 30 at 13:21







  • 2




    You are sure the service is running on the public address (192) and not just the local one (127)?
    – Raman Sailopal
    May 30 at 13:48












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Here are 2 servers



  • 192.168.0.12

  • 192.168.0.21

there is a service running in 50070 port in server 192.168.0.12



when I do telnet from 192.168.0.21 server it fails:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


When I give hostname then also it fails:



$telnet master1.mycluster 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


Even when I try from 192.168.0.12 it fails if I give the IP address:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


But it works if I give the hostname:



$telnet master1.mycluster 50070
Trying 127.0.0.1...
Connected to master1.mycluster.
Escape character is '^]'.


I found this question can not telnet to a server connection refuse, but I tried all the possibilities. These are what I tried:



  1. Turned off iptables in both the servers


  2. Added ALL: ALL in cat /etc/hosts.allow


  3. Made sure that the service is running in that port


But none of these work for me.



Here is my /etc/hosts



127.0.0.1 master1.mycluster master1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.12 master1.mycluster master1
192.168.0.21 slave1.mycluster slave1


Is there anything else that I am missing to make it working ?







share|improve this question













Here are 2 servers



  • 192.168.0.12

  • 192.168.0.21

there is a service running in 50070 port in server 192.168.0.12



when I do telnet from 192.168.0.21 server it fails:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


When I give hostname then also it fails:



$telnet master1.mycluster 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


Even when I try from 192.168.0.12 it fails if I give the IP address:



$telnet 192.168.0.12 50070
Trying 192.168.0.12...
telnet: connect to address 192.168.0.12: Connection refused


But it works if I give the hostname:



$telnet master1.mycluster 50070
Trying 127.0.0.1...
Connected to master1.mycluster.
Escape character is '^]'.


I found this question can not telnet to a server connection refuse, but I tried all the possibilities. These are what I tried:



  1. Turned off iptables in both the servers


  2. Added ALL: ALL in cat /etc/hosts.allow


  3. Made sure that the service is running in that port


But none of these work for me.



Here is my /etc/hosts



127.0.0.1 master1.mycluster master1
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.12 master1.mycluster master1
192.168.0.21 slave1.mycluster slave1


Is there anything else that I am missing to make it working ?









share|improve this question












share|improve this question




share|improve this question








edited May 30 at 13:24
























asked May 30 at 12:17









Gerg

82




82







  • 1




    My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
    – Jeff Schaller
    May 30 at 12:38










  • What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
    – ctrl-alt-delor
    May 30 at 12:56










  • @ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
    – Gerg
    May 30 at 13:19










  • @JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
    – Gerg
    May 30 at 13:21







  • 2




    You are sure the service is running on the public address (192) and not just the local one (127)?
    – Raman Sailopal
    May 30 at 13:48












  • 1




    My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
    – Jeff Schaller
    May 30 at 12:38










  • What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
    – ctrl-alt-delor
    May 30 at 12:56










  • @ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
    – Gerg
    May 30 at 13:19










  • @JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
    – Gerg
    May 30 at 13:21







  • 2




    You are sure the service is running on the public address (192) and not just the local one (127)?
    – Raman Sailopal
    May 30 at 13:48







1




1




My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
– Jeff Schaller
May 30 at 12:38




My guess is that /etc/hosts has a 127.0.0.1 entry for “master1.mycluster” — notice what it resolves to.
– Jeff Schaller
May 30 at 12:38












What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
– ctrl-alt-delor
May 30 at 12:56




What does telnet 127.0.0.1 50070 do? What addresses is the server configured to listen on. Show config file, or code.
– ctrl-alt-delor
May 30 at 12:56












@ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
– Gerg
May 30 at 13:19




@ctrl-alt-delor telnet 127.0.0.1 50070 works when running on the server where the process runs in 50070. I am pretty new to this world so where can I find the addresses that server configured to listen on? I spinned up these 2 machines using vagrant.
– Gerg
May 30 at 13:19












@JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
– Gerg
May 30 at 13:21





@JeffSchaller this is how /etc/hosts looks like 127.0.0.1 master1.mycluster master1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.12 master1.mycluster master1 192.168.0.21 slave1.mycluster slave1
– Gerg
May 30 at 13:21





2




2




You are sure the service is running on the public address (192) and not just the local one (127)?
– Raman Sailopal
May 30 at 13:48




You are sure the service is running on the public address (192) and not just the local one (127)?
– Raman Sailopal
May 30 at 13:48










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










Your service is listening on the loopback address only, 127.0.0.1.



When you make a connection from 192.168.0.21 or when you specify the ip address it does not work, as your service is not listening on that ip.



When you use the hostname from 192.168.0.12 it works because it is connecting to the loopback address. This is because it will look in your hosts file first, /etc/hosts, which has an entry pointing that hostname to your loopback ip: 127.0.0.1 master1.mycluster






share|improve this answer





















  • shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
    – Gerg
    May 31 at 12:07










  • This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
    – rusty shackleford
    May 31 at 12:26










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446893%2funable-to-telnet-to-a-server%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










Your service is listening on the loopback address only, 127.0.0.1.



When you make a connection from 192.168.0.21 or when you specify the ip address it does not work, as your service is not listening on that ip.



When you use the hostname from 192.168.0.12 it works because it is connecting to the loopback address. This is because it will look in your hosts file first, /etc/hosts, which has an entry pointing that hostname to your loopback ip: 127.0.0.1 master1.mycluster






share|improve this answer





















  • shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
    – Gerg
    May 31 at 12:07










  • This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
    – rusty shackleford
    May 31 at 12:26














up vote
3
down vote



accepted










Your service is listening on the loopback address only, 127.0.0.1.



When you make a connection from 192.168.0.21 or when you specify the ip address it does not work, as your service is not listening on that ip.



When you use the hostname from 192.168.0.12 it works because it is connecting to the loopback address. This is because it will look in your hosts file first, /etc/hosts, which has an entry pointing that hostname to your loopback ip: 127.0.0.1 master1.mycluster






share|improve this answer





















  • shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
    – Gerg
    May 31 at 12:07










  • This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
    – rusty shackleford
    May 31 at 12:26












up vote
3
down vote



accepted







up vote
3
down vote



accepted






Your service is listening on the loopback address only, 127.0.0.1.



When you make a connection from 192.168.0.21 or when you specify the ip address it does not work, as your service is not listening on that ip.



When you use the hostname from 192.168.0.12 it works because it is connecting to the loopback address. This is because it will look in your hosts file first, /etc/hosts, which has an entry pointing that hostname to your loopback ip: 127.0.0.1 master1.mycluster






share|improve this answer













Your service is listening on the loopback address only, 127.0.0.1.



When you make a connection from 192.168.0.21 or when you specify the ip address it does not work, as your service is not listening on that ip.



When you use the hostname from 192.168.0.12 it works because it is connecting to the loopback address. This is because it will look in your hosts file first, /etc/hosts, which has an entry pointing that hostname to your loopback ip: 127.0.0.1 master1.mycluster







share|improve this answer













share|improve this answer



share|improve this answer











answered May 30 at 13:50









rusty shackleford

1,135115




1,135115











  • shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
    – Gerg
    May 31 at 12:07










  • This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
    – rusty shackleford
    May 31 at 12:26
















  • shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
    – Gerg
    May 31 at 12:07










  • This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
    – rusty shackleford
    May 31 at 12:26















shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
– Gerg
May 31 at 12:07




shackle ford. Thank you, this explains what is going on. If I need to make it listen on connection from other servers then what I need to do? I know this question needs lot of details, but if you can give me an idea then I at least try to find how to do it from google. Mine is cantos 7 VMS.
– Gerg
May 31 at 12:07












This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
– rusty shackleford
May 31 at 12:26




This will depend on the service, a lot of applications will only listen on loopback by default. There will normally be an option to tell it which address to listen on, and normally setting it to 0.0.0.0 means listen on all addresses. But this will depend on the the application.
– rusty shackleford
May 31 at 12:26












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446893%2funable-to-telnet-to-a-server%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)