Weird telnet Issue



  • My primary workstation is a Fedora 24 box. I'm working on migrating management access to our switches and routers from telnet to SSH, but in the mean time I'm still doing a bit of telnet-ing into these devices.

    For some strange reason, when I do "telnet x.x.x", it takes 10-15 seconds for me to get a login prompt. If I do it from another workstation (Fedora or other), I do not have this issue. I'm pretty sure it's specific to my workstation, but I haven't a clue what is causing this. What's stranger is that I can ssh into my box from home (also Fedora 24), then telnet into our network equipment without any delay. So needless to say...I'm confused.

    I'm using Terminator as the terminal application. However, using the terminal that comes default with Fedora exhibits the same problem.

    Any ideas?



  • First WAG would be DNS resolution problem. Does it act the same way when using ssh?



  • @travisdh1 I always use the IP, so DNS should be out of the mix. SSH does not have this issue.



  • Definitely a weird one. I can't think of why it would do that. Is it possible that it is somehow related to Reverse DNS lookups, that your workstation is not listed in DNS and the machines into which you are remoting are trying to look it up?



  • @scottalanmiller said in Weird telnet Issue:

    Definitely a weird one. I can't think of why it would do that. Is it possible that it is somehow related to Reverse DNS lookups, that your workstation is not listed in DNS and the machines into which you are remoting are trying to look it up?

    That would make sense, except when I SSH into my box from another box, then start a telnet session without any delay. That's where I'm confused!



  • You want to know what's even weirder?! If I SSH into my box, while I'm ON that box (ssh 127.0.0.1), I can start a telnet session without any sort of delay.

    What...the...heck???



  • Super strange.. Some super weird routing issue?

    Capture it with and without a delay and see for any differences?



  • @anthonyh said in Weird telnet Issue:

    @travisdh1 I always use the IP, so DNS should be out of the mix. SSH does not have this issue.

    It doesn't matter if you go by IP, the daemon will still try to resolve your IP to host. I'd check to see if there's a configuration issue, seeing how DNS look ups can be turned off for sshd, I imagine that's true with telnetd as well, and that may be why you're having the problem with telnet, but not ssh. As far as machines go, depending on subnets and further configuration, as well as DNS server response/cache time (many people forget to add forwarders and only use the root ones, making it all slow), this could also make the issue only happen with certain machines, but not with others.



  • Maybe it is a bit of coincidence and really there is a DNS round robin involved.



  • Here is where I'm boggled that I think some are missing...

    If I am using telnet directly on my workstation, I get a 10 or so second delay before the session starts.

    If I SSH into my workstation, then use telnet, the session starts instantly.

    If I SSH into my workstation, from my workstation (e.g. ssh 127.0.0.1), then use telnet, the session starts instantly.

    What would an SSH session change to remove the delay?



  • @anthonyh said in Weird telnet Issue:

    Here is where I'm boggled that I think some are missing...

    If I am using telnet directly on my workstation, I get a 10 or so second delay before the session starts.

    If I SSH into my workstation, then use telnet, the session starts instantly.

    If I SSH into my workstation, from my workstation (e.g. ssh 127.0.0.1), then use telnet, the session starts instantly.

    What would an SSH session change to remove the delay?

    Have you checked the DNS lookup configuration for sshd_config? Because 127.0.0.1 is in the hosts file so there is no look up time, ditto with telnetd.

    This delay issue is almost always related to DNS queries, with very few exceptions. It doesn't matter what machine you are coming from or going to, if the "remote" machine doesn't have your connecting IP in its hosts file and it's configured to look up the host, you'll get a delay, especially with slow DNS queries, typically that 10 seconds means it probably timed out the request.



  • @tonyshowoff

    That makes sense, but I still don't understand how an SSH session changes the behavior of telnet. Wouldn't be the same as if I'm executing telnet on the workstation itself?



  • @anthonyh said in Weird telnet Issue:

    @tonyshowoff

    That makes sense, but I still don't understand how an SSH session changes the behavior of telnet. Wouldn't be the same as if I'm executing telnet on the workstation itself?

    When you go through SSH and execute in the shell, it's probably using a different connecting IP, I'd check that to see if you're getting the same result. Plus also you could just do:

    Edit /etc/ssh/sshd_config

    Change UseDNS to No

    restart sshd

    And I haven't used telnetd in about 15 years, but a potential solution, which may or may not work any more or for Fedora (I mostly use FreeBSD):

    Edit /etc/hosts.allow

    Add to a new line:

    in.telnetd: ALL
    

    Restart via inetd or xinetd or whatever you're using, unless it has its own service controller. Telnet is pretty much obsolete because it's plaintext.



  • This post is deleted!


  • Hmm. Something I just discovered is that even running "telnet --help" gives me the exact same delay.


Log in to reply