On your local network you won't necessarily need to use DNS to access the Pi via a different host name. The .local
domain, has been officially reserved as a Special-Use Domain Name (SUDN) specifically for the purpose of internal network usage. This way your custom local names don't conflict with existing external addresses.
This will require a service discovery process running on a local network via the mDNS/DNS-SD protocol suite. This could quite possibly already be running on your home router. If not you can install Apple's popular 'Bonjour' local network discovery service either on a Mac or on a windows machine. Of course you could always install it on the Pi as 'Avahi' using sudo apt-get install avahi-daemon
However, lets assume that there is a mDNS service already running, so straight out of the box the Pi should be able to be accessed using the host name raspberrypi
. Because it is on your local network you would use raspberrypi.local
Therefore from your PC you would access it using;
ssh [email protected]
To change the host name for the Pi you can either edit /etc/hosts
and /etc/hostname
using sudo and nano, changing 'raspberrypi' for a name of your choice (then reboot for it to take effect);
sudo nano /etc/hostname
sudo nano /etc/hosts
... or you can do it via sudo raspi-config
where you first select 'Network options' and then 'Hostname'.