It's Linux. There is always another way...
If your goal is to be able to ping/ssh/connect to your machine from your local area network, then you can use Avahi, also known as Zeroconf and Bonjour.
Your Raspberry Pi will need to be the only machine on the network with its hostname. By default the hostname is raspberrypi , so if you have more than one Raspberry Pi on your network, you will need to change the hostnames so that each is unique. You can change the hostname by going into Menu - Preferences - Raspberry Pi Configuration - Hostname (or from the command line: sudo raspi-config - advanced - hostname).
Reboot and go to your laptop or workstation or whatever you're trying to connect *from*.
Open up a terminal or command line and do ONE of the following:
Code: Select all
If you have changed your hostname, replace raspberrypi with your new hostname.
Whether you need to put .lan or .local (or nothing) after the hostname, depends on what operating system you are trying to connect from. Ubuntu does it one way, Windows does it another... one of those three will work.
If it doesn't work on Windows, then install Apple iTunes, which will install the Bonjour protocol drivers. Reboot and try the pings again.
You can now connect over your LAN using the hostname as the domain name, without needing to know the IP address first. Note that this won't help if you're trying to connect from the outside world. But it works wonderfully from inside a LAN.
Zeroconf can do a lot more than just automatically resolve hostnames. For example it can automatically tell computers what printers are available on the network.
https://en.wikipedia.org/wiki/Zero-conf ... networking