0

I'm experiencing a problem connecting to hosts on my LAN via their hostname only when UFW is enabled.

When UFW is enabled:

  • ssh <machine> gives the message:

    ssh: Could not resolve hostname <machine>: Name or service not known
    
  • ssh <machine-ip> connects just fine.

  • ping <machine> gives the message:

    ping: <machine>: Name or service not known
    
  • ping <machine-ip> works.

When UFW is disabled:

  • ssh <machine> connects just fine.
  • ping <machine> works just fine.

If I lookup for hosts' names manually with nmap -sP 192.168.14.1/24 I can see all the hosts on my LAN with UFW enabled / disabled.

I read this question: "UFW is blocking DNS" and it's answers and I think it' irrelevant because UFW is not installed nor enabled on the remote machines I'm trying to connect to.

I allowed with ufw the app DNS as suggested by @rugk's answer and I also tried to do what the other answers proposed but it didn't help.

Do I need to manually enter the known hosts' IP addresses in /etc/hosts? I would prefer to avoid it because I'm using a laptop which isn't always connected to this specific network.

Doron Behar
  • 673
  • 8
  • 25
  • 1
    What is output of `ufw status numbered`? What DNS server are the clients using to resolve those names? Does other name resolution work? – ivanivan Feb 04 '18 at 18:52
  • In `ufw status numbered` I can see that the `DNS` app is allowed. As for your 2nd question, I think that the DNS server the clients are usually using to resolve those names is `192.168.14.1` - it is stated in `/etc/resolv.conf` which is managed by `systemd-resolved(8)`. `/etc/resolv.conf` is linked to `/run/systemd/resolve/resolv.conf` as explained in the [Arch Linux Wiki page on systemd-networkd](https://wiki.archlinux.org/index.php/Systemd-networkd#Basic_DHCP_network) – Doron Behar Feb 10 '18 at 20:07

0 Answers0