Sample Header Ad - 728x90

How can I ping my Linux system by name without manually typing hosts files?

1 vote
2 answers
135 views
If I install Windows on a computer, and plug it into my LAN, I can immediately ping it by name from any other computer. If I install MacOS on a Mac, and plug it into my LAN, I can immediately ping it by name from any other computer. If I install Linux on a computer, and plug it into my LAN......depending on the particular flavour of Linux, and what phase of the moon we're on, and whether or not I sacrificed a goat in a ceremonial circle at midnight before installing......I *may* be able to ping it by name, or I may not. The Internet is [full](https://unix.stackexchange.com/questions/323924/cant-ping-to-another-linux-machine-by-hostname) [of](https://unix.stackexchange.com/questions/225315/my-linux-pc-not-pingable-using-hostname) [forum](https://www.linuxquestions.org/questions/red-hat-31/ping-works-with-ip-address-but-fails-if-i-use-hostname-os-is-red-hat-server-6-2-a-948745/) [posts](https://www.linuxquestions.org/questions/linux-newbie-8/not-able-to-ping-hostname-4175615966/) [asking](https://www.linuxquestions.org/questions/linux-newbie-8/i-can-ping-ip-but-not-hostname-4175624845/) [this](https://www.linuxquestions.org/questions/linux-networking-3/can%27t-ping-domain-name-but-can-ping-ip-address-331508/) [exact](https://www.linuxquestions.org/questions/linux-networking-3/can%27t-ping-linux-machine-by-hostname-47268/) [question](https://askubuntu.com/questions/1311363/i-cant-ping-by-hostname-ubuntu-server) . And the Internet is full of answers like "go into your router's settings and add a DNS entry" or "edit the hosts file on every computer and add a line for the new computer". No. Clearly the mechanism exists for automatic configuration, so I want to use that. **My question is, therefore:** What package(s) can I install or configure on Linux – Debian, Alpine, or whatever else I choose to run – that will automatically register the machine's hostname with my router, like happens naturally with Windows and Mac without any user intervention? It must be possible. Some answers suggest avahi-daemon, but I installed and configured it and it still does not work. My own experiences suggest that samba will do it; but I don't want to open up that security hole. I assume that during the installation of samba it also drags a bunch of other stuff in, one part of which actually does the DNS fix....maybe?
Asked by Sod Almighty (143 rep)
Mar 22, 2024, 02:51 PM
Last activity: Mar 22, 2024, 06:55 PM