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 as the name server its using?

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

If I run "systemd-resolve --status" I can see that 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


  • What ip route shows in Elementary terminal?
    – Sysadmin
    Apr 27, 2020 at 16:48

1 Answer 1


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:      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 and acknowledge you have read our privacy policy.

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