Telnet returns Name or service not known

16,257

On a RHEL7 system, typing telnet 192.168.1.100:1521 results in exactly your error message:

telnet: 192.168.1.100:1521: Name or service not known
192.168.1.100:1521: Unknown host

... so it seems likely to me that there was an accidental copy/paste of the command with a colon instead of a space:

telnet 192.168.1.100 1521

Tested with:

rpm -qf $(type -p telnet)
telnet-0.17-64.el7.x86_64
Share:
16,257

Related videos on Youtube

Author by

Ali Golestan

Experienced Linux System Administrator with a demonstrated history of working in the information technology and services industry

Updated on September 18, 2022

Comments

  • Ali Golestan 3 months

    I'm trying to telnet from Centos 7 to Centos 6.8 on port 1521:

    #telnet 192.168.1.100 1521

    And I get the following error

    telnet: 192.168.1.100:1521: Name or service not known 192.168.1.100:1521: Unknown host

    Firewall is disable on both machines. Selinux is disabled on both machines. Ping is working fine on both machines.

    • Bodo
      Bodo almost 4 years
      Are you sure you typed telnet 192.168.1.100 1521 (correct)? Or did you type telnet 192.168.1.100:1521 (wrong)?
    • Ali Golestan almost 4 years
      as you see in the question i typed telnet 192.168.1.100 1521
    • Bodo
      Bodo almost 4 years
      I asked because I get a similar error message when I use a colon : between IP address and port number instead of whitespace. Your error message means that telnet was not able to resolve a host name 192.168.1.100:1521 which apparently is the combination of an IP address and a port number. If you really separated IP address and port number with space: Do you have an alias or function named telnet?
    • Philip Couling
      Philip Couling almost 4 years
      On Debian telnet separates host and port in an error message with a / eg: telnet: could not resolve example.com/1521: Name or service not known. So if you really did call telnet 192.168.1.100 1521 then what version of telnet are you using and on what operating system.
    • Арсений Черенков almost 4 years
      1) I see no reason to DV, 2) I don't have centos available, but in redhat that looks like correct syntax. 3) what is the result of whereis telnet and alias telnet ?