I'm running Ubuntu 18.04 on my laptop. I am trying to ping other computers on my local network using their hostname but it's not working.
$ ping ubuntudesktop
ping: ubuntudesktop: Name or service not knownI have the name servers for the wifi adapter set up as follows:Wifi adapter DNS settings
I am snooping the wifi packets using wireshark and I do not see any DNS query when I run the ping command. Why are these nameservers not being used?
On a side note - when I use nslookup for google.com for example I get the following:
$ nslookup google.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: google.com
Address: 172.217.14.238
Name: google.com
Address: 2607:f8b0:400a:803::200eI am assuming Server is the address of the DNS server? Isn't 127.0.0.53 an address for the loopback interface? Would this mean it's essentially querying itself?
21 Answer
127.0.0.53 is the address used by systemd-resolved.service
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 1224/systemd-resolv udp 0 0 127.0.0.53:53 0.0.0.0:* 1224/systemd-resolv
Hostnames of other computers will not be resolved trough the DNS service.
You need to specify them in /etc/hosts statically.
Example:
127.0.0.1 localhost 127.0.1.1 mypc 192.168.1.100 ubuntudesktop
You can edit this file trough sudo
sudo editor /etc/hosts6