1

When I use nc to test a port as followed, it prints out a result with '(?)' in it. I've looked up the man page and also online but I can't find an answer. Can someone please shed some lights? Thanks.

# nc -v -u -w 3 localhost 10003
localhost [127.0.0.1] 10003 (?) open

I have netcat-traditional 1.10-41.1

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
skwokie
  • 155
  • 8
  • 1
    Which [version of netcat](https://serverfault.com/a/960803/126632) is this? – Michael Hampton Aug 13 '19 at 19:07
  • v1.10-41.1, @MichaelHampton – skwokie Aug 13 '19 at 20:51
  • I think I didn't express myself well enough there. I'm looking for which fork of netcat you used. It sounds like you are referring to the antique netcat-traditional. Did you click the link and read the answer? Among other things it explains the differences between various forks and suggests you should not use netcat-traditional. In this particular case, an answer might not even be possible as it's been obsolete for many years. – Michael Hampton Aug 13 '19 at 20:56
  • Hi @MichaelHampton, thanks so much! Appreciated it. – skwokie Aug 13 '19 at 21:36
  • Of course the answer to the actual question asked is that the `?` indicates that there is no well-known name attached to the port number, i.e. there is no entry for port 10003 in `/etc/services`. The openbsd flavour replaces the `(?)` with `[udp/*]` becuase it too cannot find a name for the port. Whether this or the other result is "proper" is a matter of opinion. – wurtel Aug 14 '19 at 07:35

1 Answers1

2

Thanks to Michael for the point-out. It was the traditional flavor. I just installed the openbsd flavor and it prints the result properly now:

# nc -v -u -w 3 localhost 10000
Connection to localhost 10000 port [udp/*] succeeded!
skwokie
  • 155
  • 8