It's pretty standard to have 127.0.0.1 match localhost while the actual machine's name (FQDN and hostname) matches 127.0.1.1 instead. We would be happy to be told if something similar exists for IPv6!
This needs to be run within the target system (within a chroot).