0

So love Elementary OS but confused by DNS. Read another answer to a similar question but didn't understand it. Hoping someone can explain a little more clearly. My issue is resolving local hostnames. This is the testing I have done.

I have a little Raspberry Pi set up on the same network. The hostname is "raspberrypi". It is registered in DNS and I have confirmed that its hostname can be resolved using local DNS from other machines.

If I open a terminal window in Elementary and ping www.bbc.co.uk, www.amazon.co.uk or other external sites DNS resolves correctly. However if I ping the Pi - eg "raspberrypi" I simply get "Name or Service not known". Same if I try to SSH to raspberrypi - I get the same message with the added note - name cannot be resolved.

When i run "nslookup raspberrypi" it fails and returns 127.0.0.53 as the name server its using?

If I run "nslookup raspberrypi 192.168.1.1" - specifying my default internal DNS server it works fine and can resolve it.

If I run "systemd-resolve --status" I can see that 192.168.1.1 is set as the DNS server for my wireless interface.

So why isn't Elementary using the DNS server set to resolve localhost names?

Can anyone explain? Thanks

Thanks

1
  • What ip route shows in Elementary terminal? – Sysadmin Apr 27 '20 at 16:48
0

Machines on your local network don't automatically get DNS resolvable names assigned to them. You'd need to run a local DNS server or use something like pihole for that.

An easier, more immediate fix however might be to simple add an entry into your /etc/hosts file like this:

10.0.0.233      raspberrypi

that will make your pi addressable by name on this particular machine. You'd need to add a similar entry to any other machine you want to access your pi by name with.

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.