Cannot reach DietPi using hostname on LAN Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
evh
Posts: 4
Joined: Tue May 25, 2021 7:24 pm

Cannot reach DietPi using hostname on LAN

Post by evh »

Hi,

I am experiencing a problem where I cannot reach (resolve) my DietPi using its hostname on the LAN.
- I can ping its IP address.
- I can SSH to its IP address.
- I cannot do any of the above using the hostname.

I am able to do both the above using the hostname of a Pi OS installation, so I don't believe that this is an issue with my LAN config.
I have also tried using both a DHCP and Static IP configuration and it doesn't seem to make a difference.

Anyone else experiencing this?
Any thoughts on how to resolve?

DietPi v7.1.2 installed on 2 devices with both exhibiting the same issue.
Initial installation only with no new software added.

Thanks.
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reach DietPi using hostname on LAN

Post by Joulinar »

Hi,

You would need to have the hostname being resolved by your local DNS server. Depends on what your DNS server is/the DNS server your clients are using It's not really a DietPi issue.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
evh
Posts: 4
Joined: Tue May 25, 2021 7:24 pm

Re: Cannot reach DietPi using hostname on LAN

Post by evh »

Joulinar wrote: Tue May 25, 2021 7:38 pm Hi,

You would need to have the hostname being resolved by your local DNS server. Depends on what your DNS server is/the DNS server your clients are using It's not really a DietPi issue.
That is the part that I don't get.
If it was an issue with my DNS resolver (my router) then would I not have the same issue with Pi OS?
If I was unable to resolve Pi OS hostnames then I'd agree that the problem is outside of DietPi, but that's not the case.

Pi OS on a device and I can reach it using hostname.
DietPi on the same/similar device and I cannot reach it using hostname.

That doesn't sound like a problem with my LAN config to me.
For me it sounds like something that Pi OS is doing and DietPi isn't doing?
evh
Posts: 4
Joined: Tue May 25, 2021 7:24 pm

Re: Cannot reach DietPi using hostname on LAN

Post by evh »

So I just swapped out the mSD card in my Pi Zero W.
Pi OS Lite installation with WiFi and SSH included for headless access.

Booted it up and pinged 'raspberrypi.local' and I received a response and IP address immediately.
SSH'ed to it and logged in, changed the hostname and rebooted.
Pinged the new hostname and I received a responde and the same IP address.

I tested that twice. NO problems.

So now I am convinced that there is something that Pi OS is doing to "register" that hostname that DietPi is not doing...
Absolutely no changes on the LAN as well.
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reach DietPi using hostname on LAN

Post by Joulinar »

first of all, DietPi is Raspberry OS in an extrem slim/diet version. Due to this DietPi is running with a reduced number of packages installed. Probably plain RPi OS by default has Avahi-Daemon installed. You could try and have it installed using dietpi-software.

DNS resolution is done by your router. Did you checked the name that is present on your router? You could try a revers lookup from your Windows box

Code: Select all

nslookup <IP-address>
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
evh
Posts: 4
Joined: Tue May 25, 2021 7:24 pm

Re: Cannot reach DietPi using hostname on LAN

Post by evh »

Joulinar wrote: Tue May 25, 2021 11:06 pm first of all, DietPi is Raspberry OS in an extrem slim/diet version. Due to this DietPi is running with a reduced number of packages installed. Probably plain RPi OS by default has Avahi-Daemon installed. You could try and have it installed using dietpi-software.

DNS resolution is done by your router. Did you checked the name that is present on your router? You could try a revers lookup from your Windows box

Code: Select all

nslookup <IP-address>
Thanks very much for your reply.

I know that DietPi is a slimed-down version of Pi OS which is why I like it very much and prefer it on smaller devices like the Pi Zero.
I have installed Avahi-Daemon and this has resolved the issue, so thanks very much.

I also know and agree that the resolution is performed by the Router but it can only resolve what it knows.
Many home installations use their base Internet router to perform this function and many of those devices offer bare-minimum functionality and are therefore not that configurable IMO...

Is there perhaps not value in making a product like Avahi-Daemon part of the base install, or maybe more visible as part of the install or initial config procedure to catch such hostname resolution issues earlier?
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reach DietPi using hostname on LAN

Post by Joulinar »

The idea of DietPi is to run with less possible amount of packages as possibile. This include Avahi-Daemon as well. And I could not recall that there was such a request in past. I guess this is not a feature people really needs ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply