On a fresh raspbian jessie install, /etc/hosts
is configured the same way. Here's what mine looks like on my RPi named "desktop". I manually edited it to replace "raspberrypi" with "desktop":
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 desktop
There's more info on the debian site:
The IP address 127.0.1.1 in the second line of this example may not be found on some other Unix-like systems. The Debian Installer creates this entry for a system without a permanent IP address as a workaround for some software (e.g., GNOME) as documented in the bug #719621.
In short: If you are assigning the RPi a permanent IP address, can put that address in place of 127.0.1.1. This is a debian thing, not a RPi thing.
[Edit] Regarding the discrepancy in names between /etc/hosts
and /etc/hostname
, it doesn't seem to originate with raspi-config
. The relevant lines that it uses to update the hostname are:
if [ $? -eq 0 ]; then
echo $NEW_HOSTNAME > /etc/hostname
sed -i "s/127.0.1.1.*$CURRENT_HOSTNAME/127.0.1.1\t$NEW_HOSTNAME/g" /etc/hosts
ASK_TO_REBOOT=1
fi
The resulting name should be identical in both files, at least using raspbian jessie on ARM.