You are not logged in.
Before the switch to systemd, I was able to ssh between my two machines via user@hostname but now I get a "could not resolve hostname" error and have to use the IP address instead. I set the hostname with hostnamectl and in /etc/hostname but curiously enough, my wireless router no longer displays the hostname under DHCP clients.
There is no system but GNU and Linux is one of its kernels.
Offline
Nothing to do with systemd... you may need to define your hosts in /etc/hosts in this format:
192.168.0.105 mars
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Before the switch to systemd, I was able to ssh between my two machines via user@hostname but now I get a "could not resolve hostname" error and have to use the IP address instead. I set the hostname with hostnamectl and in /etc/hostname but curiously enough, my wireless router no longer displays the hostname under DHCP clients.
On the top of my head, it looks like a problem with /etc/nsswitch.conf, specifically the "hosts:" entry. Can you post this file? AFAICT, my arch clients successfully advertise their names to the router. So if I use the router as a DNS server, I can refer to my machines by name.
Note that with nss-myhostname, /etc/hosts becomes largerly irrelevant. In fact, on a non-router machine with non-empty /etc/hostname, you can simply revert the hosts file to its default state (shipped with core/filesystem).
If you run an arch-based router, you still need to add router's hostname if you want to refer to the router by its name from any LAN device , e.g.
% cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
10.0.0.1 router1.homenet router1
# End of file
where LAN is on the 10.0.0.0/24 subnet. Then, I can do "ssh router1" instead of "ssh 10.0.0.1".
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
I'd rather not manually define local IP addresses when it worked automatically before. Oddly enough, a recent update introduced a package conflict between systemd and nss-myhostname...
There is no system but GNU and Linux is one of its kernels.
Offline
It's not odd, it's by design.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Finally fixed this by adding my hostname to /etc/hosts!
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost hostname
::1 localhost.localdomain localhost
# End of file
Last edited by kahlil88 (2013-03-04 13:04:04)
There is no system but GNU and Linux is one of its kernels.
Offline
Hey guy, I was banging my head on something similar too for a little while. If you install Avahi (https://wiki.archlinux.org/index.php/Avahi) and it will take care of your hostname resolution. Now I can finally ssh to a name and not an IP again
Offline
Hey guy, I was banging my head on something similar too for a little while. If you install Avahi (https://wiki.archlinux.org/index.php/Avahi) and it will take care of your hostname resolution. Now I can finally ssh to a name and not an IP again
Avahi is already installed and enabling the service didn't seem to make a difference. Turns out the dhcpcd service was disabled, working great now.
Last edited by kahlil88 (2013-03-06 11:00:12)
There is no system but GNU and Linux is one of its kernels.
Offline