Platform: RHEL 5.10

netcat Version: 1.84-10.fc6

I was trying to figure out if my inability to ssh was TCP-level and usually I use nc for this. This time, however, I got something unexpected.

[jadavis6@ditirlns01 ~]$ nc -vz dixxxldv02.xxx.xxx 22 -w 15
nc: connect to dixxxldv02.xxx.xxx port 22 (tcp) timed out: Operation now in progress
Connection to dixxxldv02.ncat.edu 22 port [tcp/ssh] succeeded!

Normally if it can't connect within the specified timeout it just prints the first line. Thinking it was just some weird race condition (like the TCP connection kept completing just as I was approaching timeout) I lengthened the timeout period to 30 seconds but got the same exact results.

Telnet also fails so I think there is an IDS/Network Firewall blocking the traffic. I was just curious if anyone has seen this before or what it mean.


Shortly after posting, I found the problem:

[jadavis6@ditirlns01 ~]$ host ditirldv02.ncat.edu
ditirldv02.ncat.edu has address
ditirldv02.ncat.edu has address
[jadavis6@ditirlns01 ~]$

So it appears that nc will cycle through all A records for a given host and test each one individually. The first failure was for the incorrect IP address, the success was for the correct one.

  • 1
    That's usually how it goes 8-) – slm Dec 13 '13 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.