2

I recently upgraded from 16.04 to 18.04 and now I am not able to resolve hosts on my local network. With 16.04 everything worked fine.

I am still able to use IP to reach other computers but using host name gives error message:

ssh: Could not resolve hostname myhost: Name or service not known

Same result when using firefox to reach a web service on this host.

Usingnmap -sP 192.168.2.1/24 from this post will find all hosts on the network.

Any ideas?

Niels
  • 23
  • have you tried ssh username@myhost.local? – user68186 Jun 05 '18 at 18:47
  • can you edit you post to add some information? cat /etc/hosts; sudo netstat -antup | grep LISTEN; cat /var/run/systemd/resolve/resolv.conf | grep name ... Thank you – cmak.fr Jun 05 '18 at 18:53

2 Answers2

2

In Ubuntu the local host names have ".local" in the end

By default, Ubuntu includes avahi. This is an implementation of zeroconf which allows computer hostnames to be resolved with the virtual .local name. Based on this convention, try the command:

ssh remoteuser@myhost.local

If the usernames in both the computers are identical, you can leave the remoteuser@ part out end enter:

ssh myhost.local

See What does ".local" do?

Hope this helps

user68186
  • 33,360
1

Its your firewall configuration. Its blocking your connection.

For graphical management of the default Ubuntu firewall, install GUFW and set the out going connections to allow. For more information on how to use, read documentation here.

schartz
  • 119