You are not logged in.
I can ping machines on my home LAN via IP address, but not by hostname. (Actually, I can ping the local machine I'm actually using by hostname.)
The wiki page on Network Configuration says: (https://wiki.archlinux.org/index.php/Ne … resolution):
To allow other machines to address the host by name, it is necessary to either:
- Configure the hosts(5) file, or
- Enable a service which resolves the hostname.Note: systemd provides hostname resolution via the myhostname nss module, enabled by default in /etc/nsswitch.conf. However, clients may still rely on /etc/hosts, see [2] [3] for examples.
On both i7pc and ee901, I'm using systemd, and have nss enabled in /etc/nsswitch.conf, like this:
hosts: files mymachines resolve [!UNAVAIL=return] dns myhostnameHowever, my /etc/hosts files are quite different on the two machines. I suspect they may be the root of the problem, but I don't quite understand what entries the hosts files should have... :-/
127.0.0.1 localhost.localdomain localhost
127.0.0.1 i7pc.localdomain i7pc
::1 localhost.localdomain localhost127.0.0.1 eee901.localdomain eee901 localhost
::1 eee901.localdomain eee901 localhostCan anyone help? :-)
Last edited by esuhl (2018-01-03 21:31:59)
Offline
In each machines hosts file you need to add an entry for all of the machines you wish it to resolve, so on i7pc you need to add the line...
192.168.1.10 ee901And on ee901 you need to add the line...
192.168.1.11 17pcObviously replacing the IP's with their correct value.
Offline
In each machines hosts file you need to add an entry for all of the machines you wish it to resolve...
Ah, right -- thanks!
Is there a way to do this without using static IPs? The wiki seems to imply that hostname resolution should happen automatically...?
systemd provides hostname resolution via the myhostname nss module, enabled by default in /etc/nsswitch.conf
Last edited by esuhl (2018-01-02 23:58:35)
Offline
See https://bugs.archlinux.org/task/56684? and man nss-myhostname
If you have in /etc/nsswitch.conf
hosts: files mymachines myhostname resolve [!UNAVAIL=return] dnsThen in theory a blank /etc/hosts should work for all executables that use nsswitch at least as a fallback you could add
/etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhostOffline
Thanks I didn't know about that bug. :-)
I followed those suggestions and, after a lot of playing around, I found that starting the systemd-resolved service fixed the problem!
Cheers all :-)
Offline
It should have worked without the need to change to systemd-resolved provided you adjusted the hosts to move myhostname before resolve glad the issue is resolved anyway.
Offline