I'm trying to understand why netcat is listening on any address. Here is the command I give and the response I get

# nc -l -p 9500 -vvu 9500
Warning: Inverse name lookup failed for `'
Listening on any address 9500

A few things to note:

  1. I'm running this command on a custom board and at the moment cannot upgrade my netcat.
  2. Here is the output of nc --version


netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003  Giovanni Giacobbi

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.

Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
  1. Here is the output of my uname -a


Linux bpu-modem-21 4.14.0-xilinx-v2018.2 #1 SMP PREEMPT Thu Nov 8 15:48:00 PST 2018 armv7l armv7l armv7l GNU/Linux

4.Here is the output of my cat /proc/sys/kernel/osrelease, 4.14.0-xilinx-v2018.2

The question is: how do I make netcat to listen on a specific address?


man netcat:

       Specifies the source address used for creating sockets.  In listen
       mode and tunnel mode this switch specifies the bound address, and
       it is generally a good idea not to specify this, which causes net‐
       cat to bind to a generic interface.  In the connect mode, this
       switch is used to specify the source address for connecting to the
       outside world.  Again, if it's not specified a proper address for
       the destination route will be used.
| improve this answer | |

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.