For those who want to try it at home:

ping 33333333
ping 55555555

I am sorry, two random Internet users in Korea and Germany, your IP addresses are simply special.

  • SpiceDealer@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    6
    ·
    6 hours ago

    I’m probably going to get downvoted to hell but I have to ask: Can someone please explain? I’m perpetually trying to expand my knowledge on the technical side of Linux.

    • Fred@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      edit-2
      5 hours ago

      This is the behaviour of inet_aton, which ping uses to translate ASCII representations of IPv4 addresses to a 32 bit number. Its manpage: https://man7.org/linux/man-pages/man3/inet_aton.3.html

      It recognizes the usual quad decimal notation of course, but also addresses of the form a.b.c or a.b, or in this instance, a, with is taken to be a 32bit number.

      Each part can also be written in hex or octal, with the right prefix, such that 10.012.0x800a is as valid form for 10.10.128.10.

      Not all software use inet _aton to translate ASCII addresses. inet_pton for instance (which understands both v4 and v6) doesn’t

    • jaupsinluggies@feddit.uk
      link
      fedilink
      arrow-up
      2
      ·
      5 hours ago

      An IP address is a 32-bit number, usually expressed as four 8-bit numbers separated by dots. Converting 33333333 to hex we get 01FCA055; splitting that into pairs and converting back to decimal gives 1, 252, 160, 85.

    • NoFood4u@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      5 hours ago

      Typically an IP address is represented as 4 8-bit integers (1.252.160.85), but it can also be represented as a single 32-bit integer (33333333). The ping utility accepts both forms.