Hi! I cannot SSH into a CentOS VM from an Ubuntu 18.04 machine using the hostname, but I can using the IP address. For example: ssh user@centos8vm.local does not work but ssh user@10.10.10.1 works. The strange thing is when I reboot the vm I'm able to ssh using the hostname a couple of times before I get the error unable to resolve hostname. Also, I can ssh into another Ubuntu 18.04 VM using the hostname and ip. It's only the CentOS vm that's has the issues. This is a soho network with no local dns server. We're using avahi for the multicast DNS to resolve hostnames without a central DNS server.
I'm new to linux so maybe I missed somethings. Here are some sample configs:
/etc/hosts file:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.1.1 centos8vm.local centos8vm
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.1 centos8vm.local centos8vm
/etc/hostname file:
centos8vm
/etc/nsswitch.conf file:
passwd: sss files systemd
group: sss files systemd
netgroup: sss files
automount: sss files
services: sss files
shadow: files
hosts: files dns
bootparams: files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
publickey: files
aliases: files
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since
Unable to SSH to CentOS using Hostname
-
- Posts: 13
- Joined: 2020/01/22 22:16:05
Re: Unable to SSH to CentOS using Hostname
For one thing ...
127.0.1.1 centos8vm.local centos8vm
127.0.1.1 is an invalid address. The entire 127.x.x.x subnet is not routeable.
Almost any other subnet will work.
127.0.1.1 centos8vm.local centos8vm
127.0.1.1 is an invalid address. The entire 127.x.x.x subnet is not routeable.
Almost any other subnet will work.