If I ping localhost, I receive a reply from ::1 which IIRC is the IPV6 loopback address.
If I ping 127.0.0.1, I receive a reply from 127.0.0.1 as expected.
Why is there a difference when hostname resolution of localhost is indeed 127.0.0.1?
Please see the following screenshot: