0

On a Ubuntu 16.04 computer on the local network I can ping any other computer on the network by using "ping hostname" or by using "ping hostname.local". However, on another computer I just installed Ubuntu 18.04 on, "ping hostname" yields "Name or service not known" yet "ping hostname.local" still works.

Both computers need to be configured with static IPs.

In this specific circumstance I need "ping hostname" to work. I do not know what is so special about the 16.04 machine that makes it able to resolve local hostnames without the .local.

Does anyone have any ideas?

Here is my netplan file on the device. It may shed some light on the situation.

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
       enp3s0:
          dhcp4: no
          addresses: [192.168.1.19/24]
          gateway4: 192.168.1.1
          nameservers:
             addresses: [192.168.1.1, 8.8.8.8]

Below are results of systemd-resolve --status on the 18.04 machine

Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 3 (enp4s0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (enp3s0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.1
                      8.8.8.8
          DNS Domain: ~.

I tried adding a local search domain but it did not help

Hostnames are not defined in the 16.04 /etc/hosts. It is resolving the hostnames through my router somehow. If I connect a brand new device to my network the 16.04 machine can access it immediately via its hostname and the 18.04 machine can access it through hostname.local

Any suggestions?

  • So (the plot thickens), you have a router that is providing the DNS service, and, I assume, also the DHCP service. I shall assume that that router is located at 192.168.1.1. Then, what is the output of either dig @192.168.1.1 hostname or host hostname 192.168.1.1 or (read unix.stackexchange.com/questions/20784/…). And. if port 127.0.0.53 is active (systemd resolved): dig @127.0.0.53 hostname or similar. – Isaac Jul 7 at 4:22
  • Note that the domain set (probably in /etc/resolv) for the 18.04 computer is reported to be DNS Domain: ~. (Is that what you want?). – Isaac Jul 7 at 4:27
  • I'm not sure what the domain: ~. means. What I want is to be able to type "hostname" for any device on the network instead of "hostname.local". All of your name resolution things you suggested earlier worked fine but the 127.0.0.53 – Blaine141 Jul 7 at 4:29
  • Are both computers failing to resolve in 127.0.0.53 or only the 18.04 one? If that is failing, then the systemd resolved stub server is failing to work. Please read the link I provided on the previous post. – Isaac Jul 7 at 4:31
0

Solved by adding the router DNS nameserver address to resolv.conf.

As the address of the computer is manually set (not using DHCP), the nameserver address information also needs to be manually configured via resolconf, for example, Not a good idea in other set-ups, but manually setting a fixed address leaves not much options.

If the router DHCP server could be configured to always give the same address to the computer, there is no need to manually edit resolv.conf.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.