Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    Great advice! On Ubuntu Server the NSS service is not installed by default. So installing libnss-mdns "sudo apt-get install libnss-mdns" and editing the /etc/nsswitch.conf file solved the issue. In that file the hosts: line now is "hosts: files mdns4_minimal [NOTFOUND=return] dns" Commented Jan 7, 2021 at 11:26
  • Just for clarification: Adding hostname.local to /etc/hosts would only work if the IP of hostname didn't change, right? I copy and run the VM on different hosts in different environments, so the IP will change due to DHCP. Regards and thank you for your help Commented Jan 7, 2021 at 11:40
  • 1
    Yes, if the VM's IP address is not static, you need to update /etc/hosts every time the address changes. DNS has the same problem, except if you configure DDNS (dynamic DNS configuration updates). Perhaps Avahi would be the best solution then, but it only works when the VM is on the same network as the SSH client. Commented Jan 7, 2021 at 23:37