45

I'm using a Debian 9 image on a virtual machine. The ping command is not installed. When I run:

sudo apt-get install ping

It asks me:

Package ping is a virtual package provided by:
  iputils-ping 3:20161105-1
  inetutils-ping 2:1.9.4-2+b1
You should explicitly select one to install.

Why is there two ping utilities? What are the differences between them? Is there some guidelines to choose one version over the other? What are the implications of this choice? Will all scripts and programs be compatible with both versions?

4 Answers 4

37

iputils’s ping supports quite a few more features than inetutilsping, e.g. IPv6 (which inetutils implements in a separate binary, ping6), broadcast pings, quality of service bits... The linked manpages provide details.

iputilsping supports all the options available on inetutilsping, so scripts written for the latter will work fine with the former. The reverse is not true: scripts using iputils-specific options won’t work with inetutils.

As far as why both exist, inetutils is the GNU networking utilities, targeting a variety of operating systems and providing lots of different networking tools; iputils is Linux-specific and includes fewer utilities. So typically you’d combine both to obtain complete coverage and support for Linux-specific features, on Linux, and only use inetutils on non-Linux systems.

2
  • Thank you for your answer. You say that typically you combine both to obtain complete coverage but as both implement the virtual package ping, If I install one the other is removed. How do you combine them? Oct 25, 2017 at 14:09
  • @Ortomala I meant that you combine both sets of utilities: for example, ftp from inetutils, ping from iputils, etc. (That part of my answer wasn’t focused on ping specifically.) Oct 25, 2017 at 14:18
11

inetutils-ping is the portable GNU implementation, which is used on non-Linux Debian systems (such as Debian GNU/kFreeBSD).

iputils-ping is Linux only, but does have more features. If you are using Linux, you probably want iputils version of ping.

4
  • 1
    I learned from @StephenKitt's answer that iputils-ping supports ipv6 with same binary (ipv6 is a symlink), while inetutils-ping provides a separate ping6 binary. Both support ipv6, but the symbolic links aren't visible from packages.debian.org file listings.
    – sebasth
    Oct 25, 2017 at 13:02
  • i have tested the ping from both packages . ping6 seems to work only when installing the inetutils-ping thx again
    – GAD3R
    Oct 25, 2017 at 13:08
  • @GAD3R What do you need the ping6 command for, if ping from iputils-ping supports both protocols? You can force it to use only either protocol with the -4 and -6 switches, should the need arise. Oct 25, 2017 at 13:35
  • 1
    @GAD3R that’s weird, iputils-ping installs a ping6 symlink, so you should be able to ping6 :: without installing inetutils-ping at all (and I can, on the systems I’ve checked this on). Oct 25, 2017 at 14:20
2

You can install one of them , the tow package provide the ping binary , the inetutils-ping will provide an additional tool ping6

0
2

iputils-ping performs DNS reverse lookup via PTR query. You will have to wait for a timeout if there is no response from your DNS server.

inetutils-ping performs way more better in this situation.

3
  • Both implementations by default try to resolve IP addresses into names using reverse DNS lookups and require the -n option to disable this behavior. Would you explain, how exactly inetutils-ping performs better? Mar 13 at 0:26
  • @SebastianSchrader For iputils-ping, -n sets opt_numeric, which determines whether pr_addr will call getnameinfo without NI_NUMERICHOST, where a PTR query may happen. For inetutils-ping, it always calls inet_ntoa to convert sockaddr to string, a PTR resolution never happens. The interpretation of the -n flag and implementation of name resolution is rather complex behind the scene. It depends on what option you are using, what kind of response you are receiving, and even more. In general, iputils-ping may stuck when your DNS resolver doesn't respond to a PTR query in time.
    – youfu
    Mar 14 at 16:04
  • Thanks for the details. getnameinfo with NI_NUMERICHOST (on glibc at least) is basically just a wrapper for inet_ntop (for IPv6 link-local addresses, it also tries to resolve the scope_id to an interface name using if_indextoname). With -n iputils-ping should therefore perform well too. Mar 14 at 19:46

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.