Can't ping or DNS resolve the EndeavourOS machine

I just installed EndeavourOS. I set my hostname using the command sudo hostnamectl set-hostname shuttle. When I try to ping shuttle from my other machines it is not able to resolve the IP address. I have another machine with Kubuntu installed, and I am able to ping the Kubuntu box. So it means my router isn’t the problem. Is there something I need to enable to allow the EndeavourOS to send the hostname to my router?

Asked By: iheartcsharp

||

Is in your both machine using the same DNS server, maybe you need to check your DNS server, but if you didn’t have DNS server on your server farm, you need add the hostname on your kubuntu /etc/hosts file.

[root@kubuntu ~]#vim /etc/hosts
add this line on the file -> 192.168.2.xxx shuttle
Answered By: Iyus Dedi Putra

The mere fact of setting the hostname of your system alone is not enough to make it known to other systems in your network.

Even if your router actually has a DNS service that can be aware of hosts on your local network (and this is not certain by any means), your DHCP client must 1.) actually pass the locally-configured hostname to the DHCP server in the router, and 2.) actually request for the DHCP server to perform the DNS update. Both of these things are configurable, and not necessarily enabled by default. And often the router’s "DNS server" is essentially just a proxy for the ISP’s DNS service, which does not care about hosts in your local network at all.

If the hostname resolution in your local network has "just worked" before, it is much more likely that it’s been using an alternative mechanism instead of plain DNS. For Linux and macOS systems, this mechanism is multicast DNS (mDNS), a part of Avahi/Bonjour/Zeroconf services. Windows previously used NetBIOS (which is now very much deprecated after the WannaCry worm exploited an unfixable design flaw in it) and LLMNR (another link-local hostname resolution protocol), but is apparently now adding mDNS support too.

In Linux, mDNS works by having the avahi-daemon announce the identity of your system periodically to the local network segment, and answer with the relevant information if anyone on the local system sends out a query for this system’s name. This takes care of other hosts being able to find this one; the other part is a name server switch module that allows the Linux system to seamlessly use mDNS in addition to regular DNS. In Debian and related distributions this comes packaged as libnss-mdns; if the hosts: line of your /etc/nsswitch.conf file includes keywords like mdns, mdns4 or mdns6, it should be in use.

There are also keywords mdns4_minimal, mdns_minimal, which will enable mDNS only for hostnames qualified with the special domain name .local. So trying ping shuttle.local may have different results from just ping shuttle.

Alternatively, if you use systemd-resolved as your DNS resolver (indicated by the use of the keyword resolve instead of dns in your /etc/nsswitch.conf, or the presence of nameserver 127.0.0.53 in /etc/resolv.conf), it can use both mDNS and LLMNR in addition to classic DNS to resolve the names of other hosts. Check the output of resolvectl to see if mDNS is actually enabled or not.

If your EndeavourOS has either the mDNS resolver component or systemd-resolved installed and configured, but no avahi-daemon to announce its identity to other hosts, that would explain why EndeavourOS can resolve the Kubuntu system, but not vice versa. Kubuntu includes avahi-daemon in its default configuration; I’m not very familiar with EndeavourOS.

Answered By: telcoM
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.