telnet on specific port??

Hi all,

I have a problem. I have machine names and their IP addresses in /etc/hosts file. My application does telnet on that machine host name. The application does not uses IP address for tenet. It will fetch the host name from /etc/hosts file.

Now the telnet server runs on customized port. I know that we can't define ports in /etc/hosts file. Do we have any other option to run that telnet on host name but internally on IP:port?

Thanks in advance...

What do you mean with "internally" ? You can connect to a telnet server running on a non-standard port using the sintax:

telnet <hostname> <port>

Yes I can do telnet using non standard port

telnet 192.168.1.10 90

my /etc/hosts file had below entry

192.168.1.10 mac1.fqdn.com mac1

and the application software does telnet on host name getting it from /etc/hosts file

telnet mac1

Is there any idea how to resolve this problem?

Thanks...

You may need to modify your "/etc/services" file and replace the standard port 23 with 90:

telnet          90/tcp                          # Telnet
telnet          90/udp

Yes I thought about changing /etc/services file for telnet port... but there are other machines too which is accessible on telnet standard port..

First I must ask why you would want to telnet to another port number as this will only give you access to the functions associated with the application which has that port assigned to it! Using telnet to access any port other than the TCP / UDP port assigned to telnet is a method of checking whether the port is open through a firewall. What are you trying to achieve?

telnet mac1 90